99_backup.pm supports <backupcmd> if set as a global attribute

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1594 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mfr69bs
2012-06-01 21:34:21 +00:00
parent 222a2847aa
commit 16144759d0
5 changed files with 85 additions and 33 deletions

View File

@@ -30,6 +30,7 @@
<ul>
<a href="#attr">attr</a> &nbsp;
<a href="#backup">backup</a> &nbsp;
<a href="#CULflash">CULflash</a> &nbsp;
<a href="#createlog">createlog</a> &nbsp;
<a href="#define">define</a> &nbsp;
@@ -473,6 +474,30 @@ A line ending with \ will be concatenated with the next one, so long lines
</ul>
<a name="backup"></a>
<h3>backup</h3>
<ul>
<code>backup</code><br>
<br>
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 <a href="#backupdir">backupdir</a>
global attribute.<br>
Note: tar and gzip must be installed to use this feature.
<br>
<br>
If you need to call tar with support for symlinks, you could set the
global attribute <a href="#backupsymlink">backupsymlink</a> to everything
else as "no".
<br>
<br>
You could pass the backup to your own command / script by using the
global attribute <a href="#backupcmd">backupcmd</a>.
<br>
<br>
</ul>
<a name="define"></a>
<h3>define</h3>
@@ -804,20 +829,6 @@ A line ending with \ will be concatenated with the next one, so long lines
<li>After running &lt;housekeeping&gt; it is recommended to restart Fhem.</li>
</ul>
<br>
<b>Attributes</b>
<ul>
<a name="backupdir"></a>
<li>backupdir<br>
A folder where updatefhem will store the compressed backup file.
Note: this is a global attribute.<br>Example:
<ul>
attr global backupdir /Volumes/BigHD<br>
</ul>
</li>
</ul>
</ul>
<a name="CULflash"></a>
@@ -1164,6 +1175,47 @@ A line ending with \ will be concatenated with the next one, so long lines
only connections from these addresses are allowed.
</li><br>
<a name="backupcmd"></a>
<li>backupcmd<br>
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 <strong>one</strong>
argument to the command, like e.g.:
<br>
<ul>
<code>"/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"</code>
</ul>
This Attribute is used by the <a href="#backup">backup</a> command.<br>
Example:<br>
<ul>
attr global backupcmd /usr/local/bin/myBackupScript.sh
</ul>
</li><br>
<a name="backupdir"></a>
<li>backupdir<br>
A folder to store the compressed backup file.
This Attribute is used by the <a href="#backup">backup</a> command.<br>
Example:<br>
<ul>
attr global backupdir /Volumes/BigHD
</ul>
</li><br>
<a name="backupsymlink"></a>
<li>backupsymlink<br>
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 <a href="#backup">backup</a> command.<br>
Example:<br>
<ul>
attr global backupsymlinks yes
</ul>
</li><br>
<a name="configfile"></a>
<li>configfile<br>
Contains the name of the fhem configuration file. If <a