:: fischer-net.de

Heute (01.06.12) habe ich den neuen Befehl backup für FHEM fertig gestellt und im SVN veröffentlicht. Ab morgen 07:45 Uhr sollte er über updatefhem zur Verfügung stehen.

backup unterstützt nun neben den globalen Attributen backupdir und backupsymlink auch das globale Attribut backupcmd, mit dem man sein eigenes Script einbinden kann. Dadurch kann z.B. ein Backup aus FHEM heraus direkt in die "Cloud" gesichert werden, sofern man sich das passende Script erstellt.

Hier ein Auszug aus der commandref.html:

 

global Attributes

 

backupcmd

You could pass the backup to your own command / script by using this attribute. If this attribute is specified, then it will be started as a shell command and passes a space separated list of files / directories as one argument to the command, like e.g.:

"/etc/fhem.cfg /var/log/fhem/fhem.save /usr/share/fhem/contrib /usr/share/fhem/FHEM /usr/share/fhem/foo /usr/share/fhem/foobar /usr/share/fhem/www"

This Attribute is used by the backup command.

Example:

    attr global backupcmd /usr/local/bin/myBackupScript.sh

 

backupdir

A folder to store the compressed backup file. This Attribute is used by the backup command.

Example:

    attr global backupdir /Volumes/BigHD

 

backupsymlink

If this attribute is set to everything else as "no", the archive command tar will support symlinks in your backup. Otherwise, if this attribute is set to "no" symlinks are ignored by tar. This Attribute is used by the backup command.

Example:

    attr global backupsymlinks yes

 

Command

 

backup

The complete FHEM directory (containing the modules), the WebInterface pgm2 (if installed) and the config-file will be saved into a .tar.gz file by default. The file is stored with a timestamp in the modpath/backup directory or to a directory specified by the backupdir global attribute.

Note: tar and gzip must be installed to use this feature.

If you need to call tar with support for symlinks, you could set the global attribute backupsymlink to everything else as "no".

You could pass the backup to your own command / script by using the global attribute backupcmd.

Powered by ...

 

 

reichelt elektronik – Elektronik und PC-Technik