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
Next revisionBoth sides next revision
mobi_backup [26.09.2018 15:50] – [Error due to old flock version] Pascal Sutermobi_backup [21.01.2019 12:58] Pascal Suter
Line 6: Line 6:
 In most cases, this proves to be simple but still efficient enough, rather than trying block-level incrementals.  In most cases, this proves to be simple but still efficient enough, rather than trying block-level incrementals. 
  
-at the end of a successful backupa rotation is made and old backups are being deleted where appropriatealso a summary email is sent to the admin+One specialty of MOBI, and the main reason for writing this script in the first place, is that it runs multiple backups in parallelIt has sort of its own queue manager to do that. It will take all Job Definitions and put them in the queue and it will then run multiple in parallel. The number of parallel backup processes can be defined by setting the ''PARALLELPROCS=8'' variable in the script. Default is ''8''
  
-so here is the script.. use it at your own risk and let me know if you find bugs or have contributions to makesimply send me an email to contact at psuter dot ch+The advantage of running multiple backup jobs at once is, that you can usually reach a much higher overall throughput with multiple rsyncs running in parallel than running them one after the other because rsync is single threaded and the overhead for ssh and file checking etcis hugeSo it usually makes no sense to wait for one host to complete before backing up a second host. \\ 
 +You could also define multiple backup jobs for the same host but different directories on the host, to increase the speed of large backups.  
 + 
 +if you are looking for a solution to speed up an rsync copy process with parallel rsync invocations, take a 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
  
 to configure, simply edit the lines or add more blocks after the to configure, simply edit the lines or add more blocks after the
Line 18: Line 23:
  
 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. 
 +
 +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. 
  
 <code bash mobi.sh> <code bash mobi.sh>
Line 335: Line 342:
 rm -f /tmp/backupReport.txt rm -f /tmp/backupReport.txt
 </code> </code>
 +===== run daily =====
 +in order to run the backup daily, run ''crontab -e'' as user ''root'' and enter a new line like this one here: 
 +  00 1 * * * /opt/mobi.sh > /dev/null 2>&1
 +using the redirects of both stdout and stderr to ''/dev/null'' makes sure you don't receive two emails on every backup where one would come through cron. all the necessary info is logged and the summary is emailaed directly without needing cron to send us any info. 
 +
 ===== 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: 
  • mobi_backup.txt
  • Last modified: 15.03.2022 16:23
  • by Pascal Suter