Backup solution like rsnapshot that's easy on the hard disks...
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Backup solution like rsnapshot that's easy on the hard disks...
Hello everyone!
Currently, I have one server which I use to keep backups from various places. I use rsnapshot and keep backups of 3 remote servers, as well as some local directories. So, there is a lot of files to sync.
The problem is, rsnapshot is very slow, especially when it's removing directories, which can take literally hours (and this is amplified by the fact that I use relatively slow hard disks for storage - both for their price and to keep the server quiet as it's in my office). I'd like to do hourly backups every 4 hours, but it will, every once in a while, take more than 3-4 hours to complete one backup cycle!
Are there any other incremental backup solutions which are as simple as rsnapshot (which is very nice otherwise) but are better suited for a large number of files?
just create a basic bash script that will use rsync and if you want to have rsync remove defunct files i believe there is a delete option you can flag, see the man page for the exact syntax.
a simple basic script could as easy as:
Code:
#!/bin/bash
### set your variables
DTSTAMP="`date +%Y-%m-%d-%H.%M.%S `"
RUSER=remote_user_name
RHOST=remote_IP_backup_server ### or DNS host name if you have that configured ###
LDIR=/path/to/local/dir/to/backup
RDIR=/path/on/backup/server/to/store/data
DOW=`date +%A`
LOG=/path/to/log/file/${DTSTAMP}-rsync.log
### call the rsync portion
rsync -aviS --exclude-from=/path/to/excludes.txt ${LDIR}/ ${RUSER}@${RHOST}:/${DOW}/ >> ${LOG} 2>&1
### clean up your log files
find /path/to/log/files/*.log -mtime +30 -exec rm '{}' \;
exit
This will store 7 days worth of data from each of the servers that are set to run. also keep in mind if you have this set to PUSH from the remote servers into the backup server you CAN run them all at the same time, but keep in mind your I/O and Network performance might suffer if you do this. I might be a good idea to stager the start times of each remote server by 15-20min that way you can still have them all run every hour.
your needs may very, but this is a start and again very basic.
just create a basic bash script that will use rsync and if you want to have rsync remove defunct files i believe there is a delete option you can flag, see the man page for the exact syntax.
Thanks for the reply. There is a problem though: If I understand correctly, each of 7 days stores a full copy of everything. Given that I currently keep 6 snapshots a day, 7 daily, 4 weekly, 12 monthly and 4 yearly, that would quite quickly fill up my disks (that would be 30 copies of everything). Rsnapshot solves this by keeping hard links to same files.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.