mobi_backup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mobi_backup [21.01.2019 12:56] Pascal Sutermobi_backup [15.03.2022 16:23] (current) – [Error due to old flock version] Pascal Suter
Line 11: Line 11:
 You could also define multiple backup jobs for the same host but different directories on the host, to increase the speed of large backups.  You could also define multiple backup jobs for the same host but different directories on the host, to increase the speed of large backups. 
  
-at the end of successful backup, a rotation is made and old backups are being deleted where appropriatealso a summary email is sent to the admin+if you are looking for solution to speed up an rsync copy process with parallel rsync invocationstake look at my [[parallel_rsync]] articleSadly the function I wrote there does not help in speeding up incremental backups at all (in contrary, it adds more overhead and hence makes an incremental backup even slower!)
  
 +at the end of a successful backup, a rotation is made and old backups are being deleted where appropriate. also a summary email is sent to the admin. 
 +===== Configuration =====
 to configure, simply edit the lines or add more blocks after the to configure, simply edit the lines or add more blocks after the
 <code>############################################################## <code>##############################################################
Line 22: Line 24:
 the script will write a hidden file named .lastdst to the backup base directory for each backup job. this file always contains the folder name of the sub directory of the last successful backup.  the script will write a hidden file named .lastdst to the backup base directory for each backup job. this file always contains the folder name of the sub directory of the last successful backup. 
  
 +===== Logs and Debugging =====
 +the script writes multiple log files. First of all it writes a new log file for every invocation to /tmp/<date-time>.log. this is a general log which contains information printed by the "queue manager". It then writes two log files for each backup job it runs. these can be found in the same directory where these backup jobs are stored (defined by ''BASEDST'') again with the start date and time of the job. one ends on ''log'' the other one ends on ''.err''. the ''.log'' file contains the standard-output of the process and the ''err'' file contains the standard-error output. so if copying a file failed for example it should be listed in the ''err'' file. 
 +
 +===== Known Issues =====
 +On systems with old rsync versions (i.e. 3.0.6) and if your data contains extended Attributes or ACL's you may get lots of ''Missing abbreviated xattr value, trusted.SGI_ACL_DEFAULT'' messages in your logs. Also your backup may get bloatet because files with ACL's or extended Attributes are constantly re-downloaded. This is due to some issues with ACL and Xattr support in old rsync versions. Either update to a newer version of Rsync or disable ACL and XATTR support by removing the ''-X'' and ''-A'' options in the bash script, that means, replace ''rsync -aAHXv'' with ''rsync -aHv''. This will disable ACL and XATTR support which menans, such attributes won't be backed up. 
 +===== the script =====
 so here is the script.. use it at your own risk and let me know if you find bugs or have contributions to make. simply send me an email to contact at psuter dot ch.  so here is the script.. use it at your own risk and let me know if you find bugs or have contributions to make. simply send me an email to contact at psuter dot ch. 
  
Line 347: Line 355:
 ===== Error due to old flock version ===== ===== Error due to old flock version =====
 when this script is run on an older linux distribution such as CentOS 6.5 for example, the provided version of flock is too old to know the ''-E'' option which specifies an exit code in case the lock could not be acquired. in such a situation you can patch the mobi.sh script using this command:  when this script is run on an older linux distribution such as CentOS 6.5 for example, the provided version of flock is too old to know the ''-E'' option which specifies an exit code in case the lock could not be acquired. in such a situation you can patch the mobi.sh script using this command: 
-  sed -i '/-E 66 //' mobi.sh+  sed -i 's/-E 66 //' mobi.sh
 this will make the script work on those systems. however, since now the exit code of flock is ''1'' when it can't acquire a lock the error message displayed in such a case might be a bit misleading, as it is the same as displayed in case of a syntax error in the rsync call. so keep that in mind when debugging such cases.  this will make the script work on those systems. however, since now the exit code of flock is ''1'' when it can't acquire a lock the error message displayed in such a case might be a bit misleading, as it is the same as displayed in case of a syntax error in the rsync call. so keep that in mind when debugging such cases. 
  
  • mobi_backup.1548071814.txt.gz
  • Last modified: 21.01.2019 12:56
  • by Pascal Suter