[HOWTO] Daily incremental backup with rsnapshot
-
- New here
- Posts: 4
- Joined: Wed Jun 09, 2010 1:39 am
Re: [HOWTO] Daily incremental backup with rsnapshot
Updating to firmware 3.4.0 will break your rsnapshot setup.
Read http://forum.qnap.com/viewtopic.php?f=142&t=40959
Read http://forum.qnap.com/viewtopic.php?f=142&t=40959
-
- Experience counts
- Posts: 1363
- Joined: Sat Feb 06, 2010 2:42 pm
- Location: Taipei, Taiwan
Re: [HOWTO] Daily incremental backup with rsnapshot
[The link is about the changed home directories in /etc/passwd]DeepBlueDiver wrote:Updating to firmware 3.4.0 will break your rsnapshot setup.
Read http://forum.qnap.com/viewtopic.php?f=142&t=40959
I have my own configuration for rsnapshot, so I don't know how easy it would be to modify the configuration in crushdepth's HOWTO, but instead of depending on the default location of root's home directory you could specify the location of a configuration file for ssh and then include the required information in that file.
For example, in your rsnapshot.conf file you could add a line like this
Code: Select all
ssh_args -o BatchMode=yes -F /etc/config/ssh/rsnapshot_config
Code: Select all
Host *
UserKnownHostsFile /etc/config/ssh/known_hosts
IdentityFile /etc/config/ssh/id_rsa
/Mike
-
- New here
- Posts: 4
- Joined: Wed Jun 09, 2010 1:39 am
Re: [HOWTO] Daily incremental backup with rsnapshot
Good idea, Mike. This should make rsnapshot independent from changes in home dir location in future firmwares.
Those following Crushdepth's HOWTO should edit ssh_args in /opt/etc/rsnapshot.conf and follow Mike's directions.
Those following Crushdepth's HOWTO should edit ssh_args in /opt/etc/rsnapshot.conf and follow Mike's directions.
-
- New here
- Posts: 5
- Joined: Wed Nov 10, 2010 10:51 pm
Re: [HOWTO] Daily incremental backup with rsnapshot
Hi!
I tried to run rsnapshot with BatchMode=yes, but that didn't help. After the firmware update running ssh with "BatchMode yes"-option doesn't work at all and I can run rsnapshot only by entering the passphrase. I also tried to run and it returned . (Logfile attached)
Does anybody know what's the specific problem with ssh after the firmware update and how it can be solved so that rsnapshot is working again ?
Thanks!
I tried to run rsnapshot with BatchMode=yes, but that didn't help. After the firmware update running ssh with "BatchMode yes"-option doesn't work at all and I can run rsnapshot only by entering the passphrase. I also tried to run
Code: Select all
"ssh -vvv -o "BatchMode yes" admin@192.168.1.2"
Code: Select all
"Permission denied (publickey,password,keyboard-interactive)."
Does anybody know what's the specific problem with ssh after the firmware update and how it can be solved so that rsnapshot is working again ?
Thanks!
-
- Getting the hang of things
- Posts: 76
- Joined: Thu Mar 26, 2009 8:56 pm
Re: [HOWTO] Daily incremental backup with rsnapshot
Please see this thread, its a simple fix. However, a better fix may be listed a few posts above in this thread, but I haven't tested it yet. The issue is that the firmware update changed the path of the home directory, so its looking for the .ssh files in the wrong place.
-
- Starting out
- Posts: 32
- Joined: Thu Jan 20, 2011 3:08 am
Re: [HOWTO] Daily incremental backup with rsnapshot
Hi.
Here is a hint for anyone who wants to have "Postpone the restart/shutdown schedule when a replication job is in progress" option
to work with rsnapshot. This works for my TS-219 and probably other systems. Just replace HDA_DATA with your device's data dir.
1) Create "scripts" directory on HDA_DATA and copy original /etc/init.d/wait_RR into it
2) Now edit /share/HDA_DATA/scripts/wait_RR.
Replace
With
3) Rename original /etc/init.d/wait_RR and symlink to new one
4) Add Step 3 into your autorun script to preserve your new /etc/init.d/wait_RR after reboot.
Refer to http://wiki.qnap.com/wiki/Running_Your_ ... at_Startup for more info
EDIT: grep fix to exclude grep process itself. Thanx to Eduardo.
Here is a hint for anyone who wants to have "Postpone the restart/shutdown schedule when a replication job is in progress" option
to work with rsnapshot. This works for my TS-219 and probably other systems. Just replace HDA_DATA with your device's data dir.
1) Create "scripts" directory on HDA_DATA and copy original /etc/init.d/wait_RR into it
Code: Select all
# cd /share/HDA_DATA
# mkdir scripts
# cp /etc/init.d/wait_RR /share/HDA_DATA/scripts
Replace
Code: Select all
/bin/ps | /bin/grep /usr/bin | /bin/grep "rsync "
Code: Select all
/bin/ps | /bin/grep "rsync " | /bin/grep -v "grep "
Code: Select all
# cd /etc/init.d
# mv wait_RR wait_RR.orig
# ln -s /share/HDA_DATA/scripts/wait_RR wait_RR
Refer to http://wiki.qnap.com/wiki/Running_Your_ ... at_Startup for more info
EDIT: grep fix to exclude grep process itself. Thanx to Eduardo.
Last edited by Ceco on Mon Jun 13, 2011 9:13 pm, edited 1 time in total.
TS-419U @ Work (4.3.3)
TS-431U @ Work (4.3.3)
TS-219P+ @ Home (4.3.3)
TS-431U @ Work (4.3.3)
TS-219P+ @ Home (4.3.3)
- paolomarino
- Easy as a breeze
- Posts: 309
- Joined: Sat Jun 13, 2009 3:24 am
- Location: Ironforge
Re: [HOWTO] Daily incremental backup with rsnapshot
I have read of a RSnapshot Qkpg:
http://forum.qnap.com/viewtopic.php?f=121&t=44555
It will be a nice develop
http://forum.qnap.com/viewtopic.php?f=121&t=44555
It will be a nice develop
Happy Qnap TS-509 Ultra (Intel E7500 + 2GB RAM + 20TB WD RED) Owner
Happy Qnap TS-870 Ultra (Intel I7-3770T + 16GB RAM + 64TB WD RED) Owner
Happy Qnap TS-870 Ultra (Intel I7-3770T + 16GB RAM + 64TB WD RED) Owner
-
- New here
- Posts: 2
- Joined: Fri Dec 31, 2010 7:38 am
Re: [HOWTO] Daily incremental backup with rsnapshot
What's the fix? I'm not seeing it.crushdepth wrote:Please see this thread, its a simple fix. However, a better fix may be listed a few posts above in this thread, but I haven't tested it yet. The issue is that the firmware update changed the path of the home directory, so its looking for the .ssh files in the wrong place.
-
- Getting the hang of things
- Posts: 83
- Joined: Wed Nov 24, 2010 8:06 am
Re: [HOWTO] Daily incremental backup with rsnapshot
The "home-directory problem" can be solved with a symlink:
Code: Select all
ln -s /root /share/homes/admin
---
2 x TS-110, WD RE3 WD1002FBYS 1TB // Seagate 7200.11 ST3500320AS 0.5 TB f/w: SD25
2x TS-119P+, WD RE4 WD1003FBYX 1TB
2x TS-119P II, WD RE4 WD1003FBYX 1TB // Seagate 7200.14 ST2000DM001 2 TB f/w: CC4H
f/w: 3.6.1; SABNZB+ 0.6.14; Twonkey 6.0.38; rsnap 3.1.2;
2 x TS-110, WD RE3 WD1002FBYS 1TB // Seagate 7200.11 ST3500320AS 0.5 TB f/w: SD25
2x TS-119P+, WD RE4 WD1003FBYX 1TB
2x TS-119P II, WD RE4 WD1003FBYX 1TB // Seagate 7200.14 ST2000DM001 2 TB f/w: CC4H
f/w: 3.6.1; SABNZB+ 0.6.14; Twonkey 6.0.38; rsnap 3.1.2;
-
- Experience counts
- Posts: 2141
- Joined: Wed May 26, 2010 2:44 am
Re: [HOWTO] Daily incremental backup with rsnapshot
I followed crushdepth guide on rsnapshot and it works well (thanks!) and I backup to /opt/var/rsnapshot.
Now the question: is it possible to mount the backup folder under a subfolder such as /share/Public/Backup and make this mount read-only (so all users can view and recover files without messing the backup)?
How can I do this?
Now the question: is it possible to mount the backup folder under a subfolder such as /share/Public/Backup and make this mount read-only (so all users can view and recover files without messing the backup)?
How can I do this?
-
- New here
- Posts: 2
- Joined: Fri Dec 31, 2010 7:38 am
Re: [HOWTO] Daily incremental backup with rsnapshot
It's still broken for me. Adding the symlink for the home directory worked, and key-based authentication is working for me when I try to log into to my target server from the shell, but whenever I try to run rsnapshot, I keep getting a password prompt. That means in wont' work automatically with my cron jobs. Any idea what I might be missing?
-
- Experience counts
- Posts: 1363
- Joined: Sat Feb 06, 2010 2:42 pm
- Location: Taipei, Taiwan
Re: [HOWTO] Daily incremental backup with rsnapshot
You can re-mount the directory read-only at a new location using the following commands,virtualdj wrote:is it possible to mount the backup folder under a subfolder such as /share/Public/Backup and make this mount read-only (so all users can view and recover files without messing the backup)?
Code: Select all
/bin/mount --bind /opt/var/rsnapshot /share/Public/Backup
/bin/mount -o remount,ro /share/Public/Backup
/Mike
-
- Experience counts
- Posts: 2141
- Joined: Wed May 26, 2010 2:44 am
Re: [HOWTO] Daily incremental backup with rsnapshot
@ micke
Thanks, actually I already tried the 2 commands you have suggested to me (I found them using Google here) but they didn't work because a normal user was able to delete the files in the backup.
Maybe I was missing this:
So apart from root/admin, other users shouldn't be able to delete files; anyway, inside the backup, the things are different (a sample follows):
Under that folder, we see 2 files created by admin and 1 created by the user "web".
However, the user "web" CAN delete everything and that's what I want to prevent. How can I do that?
Should I have to change permissions for all the files in the backup? That isn't so easy, because everytime a new backup is created the permissions have to be changed too, so I'm looking for an easier solution. The article that I linked before mentions mounting using NFS and localhost, but I don't know how to do that on QNAP (i.e. not using the webend as the folder is not shared and I want the "folder read-only view" inside another shared older). Please, can you enlighten me?
Thanks, actually I already tried the 2 commands you have suggested to me (I found them using Google here) but they didn't work because a normal user was able to delete the files in the backup.
Maybe I was missing this:
But, look, these are my permissions:micke wrote:The permissions of the file system won't change, so whether users can access files in the backup depends on the settings in /opt/var/rsnapshot.
Code: Select all
[/opt/var] # ls -l
drwxr-xr-x 3 admin administ 4096 Feb 18 20:34 cache/
drwxr-xr-x 2 admin administ 4096 May 3 17:17 empty/
drwxr-xr-x 2 admin administ 4096 May 24 20:29 log/
drwxr-xr-x 4 admin administ 4096 May 24 21:12 rsnapshot/
drwxr-xr-x 2 admin administ 4096 May 24 21:12 run/
drwxr-xr-x 3 admin administ 4096 May 16 2010 spool/
drwxr-xr-x 3 admin administ 4096 Sep 15 2010 state/
Code: Select all
[/opt/var] # ls -l rsnapshot/hourly.0/localhost/share/Public/script/
-rwxrwxrwx 2 admin administ 735 Nov 24 21:04 alreadyrunning.sh*
drwxrwxrwx 2 web everyone 4096 May 24 21:12 empty/
-rwxrwxrwx 2 admin administ 8644 Dec 7 21:33 jdn.sh*
However, the user "web" CAN delete everything and that's what I want to prevent. How can I do that?
Should I have to change permissions for all the files in the backup? That isn't so easy, because everytime a new backup is created the permissions have to be changed too, so I'm looking for an easier solution. The article that I linked before mentions mounting using NFS and localhost, but I don't know how to do that on QNAP (i.e. not using the webend as the folder is not shared and I want the "folder read-only view" inside another shared older). Please, can you enlighten me?
-
- Experience counts
- Posts: 1363
- Joined: Sat Feb 06, 2010 2:42 pm
- Location: Taipei, Taiwan
Re: [HOWTO] Daily incremental backup with rsnapshot
Note that you must run both commands in the specified order or it most likely won't work. I have tried it on my TS-239 Pro and it worked just fine (i.e. it is not possible to remove any files from the read-only mount point; not even the admin user can remove files).virtualdj wrote: Thanks, actually I already tried the 2 commands you have suggested to me (I found them using Google here) but they didn't work because a normal user was able to delete the files in the backup.
By making the file system read-only and that is exactly what the two mount commands (should) dovirtualdj wrote: However, the user "web" CAN delete everything and that's what I want to prevent. How can I do that?
When I wrote that "the permissions of the file system won't change" I meant that if a user e.g. cannot read a file in /opt/var/rsnapshot then that will still be the case in the new (read-only) mount point.
/Mike
-
- Experience counts
- Posts: 2141
- Joined: Wed May 26, 2010 2:44 am
Re: [HOWTO] Daily incremental backup with rsnapshot
After I've read your post, I've tried again. The commands are written in the correct order and the mount works:micke wrote:I have tried it on my TS-239 Pro and it worked just fine (i.e. it is not possible to remove any files from the read-only mount point; not even the admin user can remove files).
Code: Select all
# mount
/proc on /proc type proc (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
sysfs on /sys type sysfs (rw)
tmpfs on /tmp type tmpfs (rw,size=32M)
none on /proc/bus/usb type usbfs (rw)
/dev/sda4 on /mnt/ext type ext3 (rw)
/dev/md9 on /mnt/HDA_ROOT type ext3 (rw)
/dev/sda3 on /share/HDA_DATA type ext4 (rw,usrjquota=aquota.user,jqfmt=vfsv0,user_xattr,data=ordered,nodelalloc,noacl)
tmpfs on /.eaccelerator.tmp type tmpfs (rw,size=32M)
/share/HDA_DATA/.qpkg/Optware/var/rsnapshot on /share/HDA_DATA/Public/Backup type none (ro,bind)
Code: Select all
[/share/Public/Backup/daily.0/localhost/share/Public/script] # rm jdn.sh
rm: remove `jdn.sh'? y
rm: unable to remove `jdn.sh': Read-only file system
So it seems that the read-only "flag" doesn't apply to Samba (and that's the reason why I was able to delete the files before, I didn't try under SSH). Now it's becoming weird...
Unfortunately, I would like to have the folder visible under Samba (so that the other users can browse the backups without messing them).