Linux rsync - daily, weekly and monthly backups
Hello,
I need to ask for advice regarding Rsync. I want to backup the server to a backup disk on another server. And there is no Rdiff-backup. Just backups of BorgBackup and Rsync. I thought something similar to the Timeshift that they would have kept 5 backups a day, 2 weeks and 1 month.
I meant to do three folders daily, weekly and monthly, but I don't know what command to use for Rsync to create a backup by date and another command that would delete older backups.
Thank you very much for the information.
Zdenek.
Hello,
1.) Why is the problem using rdiff-backup? In addition, the backups could be automatically deleted.
2.) Borg Backup is also very convenient, it can do a lot.
3.) Daily, weekly and monthly backups using rsync will be cumbersome, it would be x tasks in cron + even delete it, then it will be difficult to know.
However what to try to back up using rsync like this:
- daily rsync backup
- weekly rsync backup
- monthly backup is made from the last daily backup, zipped and saved with the current date (so it's an archive)
PS: It's not tried, just roughly written how it could be initially solved using rsync
Hello,
thank you for your reply. In the properties of the repository have only FTP, FTPS, SFTP, SCP, Samba / CIFS, BorgBackup, rsync over SSH
HTTPS and WebDAV. So I do not know if Rdiff-Backup would go. The Borg have a pretty good instructions, but I tried Borg only through the Vorta program. But I guess you're right wasted it will be difficult through Rsync.
I tried te riff-backup rdiff-backup / home user@user.your-storagebox.de: zdendys
and it ends in an Exception 'error [Errno 36] File name too long:
Hello,
thank you for the answer. I tried Rdiff-backup
rdiff-backup / home / archos2 user@user.your-storagebox.de: archo2 and I don't know if I have to install yet.
Error:
But I will try your commands. He thinks it would be fine enough.Then Borg I do not know, although Hetzner has a pretty nice instructions on the site, but I never tried to restore backup.Only through Vorta.
Hello,
I think you can mark it as solved.Trochu I modified those commands on Rsync and just fine it will be enough.Necessary I would complicate.Tak once again thank you very much for advice.
Zdenek
Hello,
the first one is quite obvious that there is a very long file name somewhere [Errno 36] File name too long.
The second error of raised of class '' is not clear = it looks as if something is missing between the quotation marks.
It's weird, I have no problem with rdiff-backup ... So at least it helped you with the rsync example.
I need to ask for advice regarding Rsync. I want to backup the server to a backup disk on another server. And there is no Rdiff-backup. Just backups of BorgBackup and Rsync. I thought something similar to the Timeshift that they would have kept 5 backups a day, 2 weeks and 1 month.
I meant to do three folders daily, weekly and monthly, but I don't know what command to use for Rsync to create a backup by date and another command that would delete older backups.
Thank you very much for the information.
Zdenek.
REPLY
Hello,
1.) Why is the problem using rdiff-backup? In addition, the backups could be automatically deleted.
2.) Borg Backup is also very convenient, it can do a lot.
3.) Daily, weekly and monthly backups using rsync will be cumbersome, it would be x tasks in cron + even delete it, then it will be difficult to know.
However what to try to back up using rsync like this:
00 20 * * * rsync –av /home /mnt/backups/daily/ --delete
00 21 * * 6 rsync –av /home /mnt/backups/weekly/ --delete
00 22 1 * * zip -r /mnt/backups/monthly/$(date +%Y-%m-%d).zip /mnt/backups/daily
- daily rsync backup
- weekly rsync backup
- monthly backup is made from the last daily backup, zipped and saved with the current date (so it's an archive)
PS: It's not tried, just roughly written how it could be initially solved using rsync
REPLY
Hello,
thank you for your reply. In the properties of the repository have only FTP, FTPS, SFTP, SCP, Samba / CIFS, BorgBackup, rsync over SSH
HTTPS and WebDAV. So I do not know if Rdiff-Backup would go. The Borg have a pretty good instructions, but I tried Borg only through the Vorta program. But I guess you're right wasted it will be difficult through Rsync.
I tried te riff-backup rdiff-backup / home user@user.your-storagebox.de: zdendys
and it ends in an Exception 'error [Errno 36] File name too long:
ile "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 304, in error_check_Main
try: Main(arglist)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 324, in Main
take_action(rps)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 280, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 346, in Backup
backup.Mirror(rpin, rpout)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 38, in Mirror
DestS.patch(dest_rpath, source_diffiter)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 232, in patch
ITR(diff.index, diff)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rorpiter.py", line 281, in __call__
last_branch.fast_process(*args)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 528, in fast_process
tf = TempFile.new(mirror_rp)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/TempFile.py", line 36, in new
return new_in_dir(rp_base.get_parent_rp())
File "/usr/lib/python2.7/dist-packages/rdiff_backup/TempFile.py", line 46, in new_in_dir
tf = dir_rp.append('rdiff-backup.tmp.%d' % _tfindex)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 1149, in append
return self.__class__(self.conn, self.base, self.index + (ext,))
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 884, in __init__
else: self.setdata()
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 908, in setdata
self.data = self.conn.rpath.make_file_dict(self.path)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 287, in make_file_dict
return C.make_file_dict(filename)
Traceback (most recent call last):
File "/usr/bin/rdiff-backup", line 30, in
rdiff_backup.Main.error_check_Main(sys.argv[1:])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 304, in error_check_Main
try: Main(arglist)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 324, in Main
take_action(rps)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 280, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 346, in Backup
backup.Mirror(rpin, rpout)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 38, in Mirror
DestS.patch(dest_rpath, source_diffiter)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 232, in patch
ITR(diff.index, diff)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rorpiter.py", line 281, in __call__
last_branch.fast_process(*args)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 528, in fast_process
tf = TempFile.new(mirror_rp)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/TempFile.py", line 36, in new
return new_in_dir(rp_base.get_parent_rp())
File "/usr/lib/python2.7/dist-packages/rdiff_backup/TempFile.py", line 46, in new_in_dir
tf = dir_rp.append('rdiff-backup.tmp.%d' % _tfindex)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 1149, in append
return self.__class__(self.conn, self.base, self.index + (ext,))
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 884, in __init__
else: self.setdata()
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 908, in setdata
self.data = self.conn.rpath.make_file_dict(self.path)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 287, in make_file_dict
return C.make_file_dict(filename)
REPLY
Hello,
thank you for the answer. I tried Rdiff-backup
rdiff-backup / home / archos2 user@user.your-storagebox.de: archo2 and I don't know if I have to install yet.
Error:
archo2/u226493@u226493.your-storagebox.de:archo2/rdiff-backup.tmp.2116'' raised of class '':
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 304, in error_check_Main
try: Main(arglist)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 324, in Main
take_action(rps)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 280, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 346, in Backup
backup.Mirror(rpin, rpout)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 38, in Mirror
DestS.patch(dest_rpath, source_diffiter)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 232, in patch
ITR(diff.index, diff)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rorpiter.py", line 281, in __call__
last_branch.fast_process(*args)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 528, in fast_process
tf = TempFile.new(mirror_rp)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/TempFile.py", line 36, in new
return new_in_dir(rp_base.get_parent_rp())
File "/usr/lib/python2.7/dist-packages/rdiff_backup/TempFile.py", line 46, in new_in_dir
tf = dir_rp.append('rdiff-backup.tmp.%d' % _tfindex)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 1149, in append
return self.__class__(self.conn, self.base, self.index + (ext,))
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 884, in __init__
else: self.setdata()
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 908, in setdata
self.data = self.conn.rpath.make_file_dict(self.path)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 287, in make_file_dict
return C.make_file_dict(filename)
Traceback (most recent call last):
File "/usr/bin/rdiff-backup", line 30, in
rdiff_backup.Main.error_check_Main(sys.argv[1:])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 304, in error_check_Main
try: Main(arglist)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 324, in Main
take_action(rps)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 280, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.7/dist-packages/rdiff_backup/Main.py", line 346, in Backup
backup.Mirror(rpin, rpout)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 38, in Mirror
DestS.patch(dest_rpath, source_diffiter)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 232, in patch
ITR(diff.index, diff)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rorpiter.py", line 281, in __call__
last_branch.fast_process(*args)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/backup.py", line 528, in fast_process
tf = TempFile.new(mirror_rp)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/TempFile.py", line 36, in new
return new_in_dir(rp_base.get_parent_rp())
File "/usr/lib/python2.7/dist-packages/rdiff_backup/TempFile.py", line 46, in new_in_dir
tf = dir_rp.append('rdiff-backup.tmp.%d' % _tfindex)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 1149, in append
return self.__class__(self.conn, self.base, self.index + (ext,))
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 884, in __init__
else: self.setdata()
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 908, in setdata
self.data = self.conn.rpath.make_file_dict(self.path)
File "/usr/lib/python2.7/dist-packages/rdiff_backup/rpath.py", line 287, in make_file_dict
return C.make_file_dict(filename)
But I will try your commands. He thinks it would be fine enough.Then Borg I do not know, although Hetzner has a pretty nice instructions on the site, but I never tried to restore backup.Only through Vorta.
REPLY
Hello,
I think you can mark it as solved.Trochu I modified those commands on Rsync and just fine it will be enough.Necessary I would complicate.Tak once again thank you very much for advice.
Zdenek
REPLY
Hello,
the first one is quite obvious that there is a very long file name somewhere [Errno 36] File name too long.
The second error of raised of class '' is not clear = it looks as if something is missing between the quotation marks.
It's weird, I have no problem with rdiff-backup ... So at least it helped you with the rsync example.