Re: How to delete a whole destination tree (inclusive the destination its-self) with rsync (daemon)?
On Sun, 31 Oct 2010 03:15:37 +0100 Vahsen Beheer beh...@vahsen.nl wrote: Hi! I am backing up (using --link-dest, hard links) to a NAS which has an 'rsync' daemon running. I do not have ssh access to this Storage-device. Part of my script needs to delete whole remote directory trees. This seems difficult with rsync. A nice trick is to make an empty source directory: rsync -a --delete /tmp/empty-dir/ remote-host::Backups/daily.20101030-0155 This works perfect. It deletes the contents of destination. However, need it to also delete the destination directory its-self. This seems something very easy, but after searching for many hours in the manual, FAQ, Web and forum did not reveal a solution. Is it possible to have rsync also delete the 'destination-directory' ? (Or do i need to work from its parent-directory of the destination - here the module itsself ? Or do something with filters?) The next also does not work (it deletes all! from the Backups module): rsync -a --exclude='/***' --include='/daily.20101030-0155/' --delete /tmp/empty-dir/ remote-host::Backups Any tips? Did anyone ever tried this? :) Thanks a lot in advance! Robert PS: I also looked into the --prune-empty-dirs option, without success though. rsync -naivv -f '-!pr daily.20101030-0155' --del /tmp/empty_dir/ remote-host::Backups/ -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: How to delete a whole destination tree (inclusive the destination its-self) with rsync (daemon)?
On Sun, 31 Oct 2010 03:15:37 +0100 Vahsen Beheer beh...@vahsen.nl wrote: Hi! I am backing up (using --link-dest, hard links) to a NAS which has an 'rsync' daemon running. I do not have ssh access to this Storage-device. Part of my script needs to delete whole remote directory trees. This seems difficult with rsync. A nice trick is to make an empty source directory: rsync -a --delete /tmp/empty-dir/ remote-host::Backups/daily.20101030-0155 This works perfect. It deletes the contents of destination. However, need it to also delete the destination directory its-self. This seems something very easy, but after searching for many hours in the manual, FAQ, Web and forum did not reveal a solution. Is it possible to have rsync also delete the 'destination-directory' ? (Or do i need to work from its parent-directory of the destination - here the module itsself ? Or do something with filters?) The next also does not work (it deletes all! from the Backups module): rsync -a --exclude='/***' --include='/daily.20101030-0155/' --delete /tmp/empty-dir/ remote-host::Backups Any tips? Did anyone ever tried this? :) Thanks a lot in advance! Robert PS: I also looked into the --prune-empty-dirs option, without success though. Or: rsync -ndivv -f 'P!p /daily.20101030-0155' --del /tmp/empty_dir/ remote-host::Backups/ -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: How to delete a whole destination tree (inclusive the destination its-self) with rsync (daemon)?
On Sun, 2010-10-31 at 17:39 +0200, Edvinas Valatka wrote: On Sun, 31 Oct 2010 03:15:37 +0100 Vahsen Beheer beh...@vahsen.nl wrote: I am backing up (using --link-dest, hard links) to a NAS which has an 'rsync' daemon running. I do not have ssh access to this Storage-device. Part of my script needs to delete whole remote directory trees. This seems difficult with rsync. A nice trick is to make an empty source directory: rsync -a --delete /tmp/empty-dir/ remote-host::Backups/daily.20101030-0155 This works perfect. It deletes the contents of destination. However, need it to also delete the destination directory its-self. This seems something very easy, but after searching for many hours in the manual, FAQ, Web and forum did not reveal a solution. Is it possible to have rsync also delete the 'destination-directory' ? (Or do i need to work from its parent-directory of the destination - here the module itsself ? Or do something with filters?) The next also does not work (it deletes all! from the Backups module): rsync -a --exclude='/***' --include='/daily.20101030-0155/' --delete /tmp/empty-dir/ remote-host::Backups Or: rsync -ndivv -f 'P!p /daily.20101030-0155' --del /tmp/empty_dir/ remote-host::Backups/ Yes, there are a number of variations that work. I had another one here: https://lists.samba.org/archive/rsync/2007-November/019050.html -- Matt -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: How to delete a whole destination tree (inclusive the destination its-self) with rsync (daemon)?
On 31-10-2010 16:39, Edvinas Valatka wrote: On Sun, 31 Oct 2010 03:15:37 +0100 Vahsen Beheer beh...@vahsen.nl wrote: Hi! I am backing up (using --link-dest, hard links) to a NAS which has an 'rsync' daemon running. I do not have ssh access to this Storage-device. Part of my script needs to delete whole remote directory trees. This seems difficult with rsync. A nice trick is to make an empty source directory: rsync -a --delete /tmp/empty-dir/ remote-host::Backups/daily.20101030-0155 This works perfect. It deletes the contents of destination. However, need it to also delete the destination directory its-self. This seems something very easy, but after searching for many hours in the manual, FAQ, Web and forum did not reveal a solution. Is it possible to have rsync also delete the 'destination-directory' ? (Or do i need to work from its parent-directory of the destination - here the module itsself ? Or do something with filters?) The next also does not work (it deletes all! from the Backups module): rsync -a --exclude='/***' --include='/daily.20101030-0155/' --delete /tmp/empty-dir/ remote-host::Backups Any tips? Did anyone ever tried this? :) Thanks a lot in advance! Robert PS: I also looked into the --prune-empty-dirs option, without success though. Or: rsync -ndivv -f 'P!p /daily.20101030-0155' --del /tmp/empty_dir/ remote-host::Backups/ Hi Edvinas :) Thanks a lot for your response. I tried all tree of your suggestions, but i get the message: 1045: rsync -ndivv -f 'P!p daily.20101022-2209.5212' --del ~/empty/ io::Backups opening tcp connection to io port 873 sending daemon args: --server -vvnd --no-r "--log-format=%i" --delete-during . Backups/ filter rules are too modern for remote rsync. rsync error: protocol incompatibility (code 2) at /home/lapo/packaging/rsync-3.0.7-1/src/rsync-3.0.7/exclude.c(1211) [sender=3.0.7] My rsync client is 3.0.7 but the daemon on my NAS-server has an older version: rsync 2.6.9 (the last one before 3.0). Looking on the web for a 2.6.9 manpage (which i by the way was not able to find at the rsync website), i managed to find out it might be the 'p' (in the previous '-!pr') which causes the problem. Any other hints? -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: How to delete a whole destination tree (inclusive the destination its-self) with rsync (daemon)?
On 31-10-2010 18:07, edac...@gmail.com wrote: On 10/31/2010 06:52 PM, Vahsen Beheer wrote: Hi again Edvinas, and thanks a lot!!! I finally managed to delete a remote empty directory now! I simplified my request a bit though, and need to delete a subdirectory of the module. Analogue to the above I tried: rsync -ndv -f '-!r /subdir/daily.20101030-0155' --del /tmp/empty_dir/ remote-host::Backups/subdir This however does not delete anything. What am i missing? "-n" means "dry-run", no real action will be performed :). Hope found one-line solution: rsync -ndivv -f 'R /daily.20101030-0155/**' -f '-!r /daily.20101030-0155' --del /tmp/empty_dir/ remote-host::Backups/ :-) I know that it is a dry run... The thing is however that all your latter solutions work perfectly on the root of the module. However i need to delete directories which are in subdirectories of this module... I guess the problem is the anchoring of the module in combination with the filter-rules. Reading the manual about 'anchoring include/exclude patterns' and checking out the filter-rules did not help me. Can you get your last example to work with a subdirectory of a directory in the module its-self ? The thing i tried below (with the added "SUBDIR/") does not work: ( i try to remove the tree: "remote-host::Backups/SUBDIR/daily.20101030-0155") rsync -divvv -f 'R /SUBDIR/daily.20101030-0155/**' -f '-!r /daily.20101030-0155' --del /tmp/empty_dir/ remote-host::Backups/SUBDIR/ A final hint? ;) -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: osx remote backup wrong permissions
Hi All, FWIW, I got my test to work. I realized the permissions were actually ok- the owner/group bits were off. I set up a root account on the other laptop and logged out of it then ran /rsync -aNHAXx --protect-args --fileflags --protect-decmpfs --force-change --stats --progress -v --rsync-path=/rsync /private/var/audit r...@ipaddress:/Users/myUser/backup and the resulting owner (System) and Group were preserved. Does the server (or other computer in this case) always need a root account established for this to work? I tried everything else and the owner always became that of the remote user. Cheers, Rob On Oct 30, 2010, at 9:35 PM, Robert DuToit wrote: On Oct 30, 2010, at 8:27 PM, Mike Bombich wrote: On Oct 30, 2010, at 9:02 AM, Robert DuToit wrote: Hi All, I'm trying a remote backup for the first time. It is between two laptops, I installed rsync 3.0.7 on both compiled patch -p1 patches/fileflags.diff patch -p1 patches/crtimes.diff patch -p1 patches/crtimes-64bit.diff patch -p1 patches/crtimes-hfs+.dif f patch -p1 patches/hfs_compression.diff ./configure make this all works perfectly for local backups, clones etc. Everything gets copied as is to the volume. I have tried without ssh keys, with keys, keys with and without passwords (via ssh-agent) and it all works except that it won't copy the correct permissions on System files example run with locked system folder var/audit going to servern...@100.102.15.4 (not my real address here of course): sudo /rsync -aNHAXx --protect-args --fileflags --protect-decmpfs --force-change --stats --progress -vvv --rsync-path=/rsync /private/var/audit servern...@100.102.15.4:/Volumes/Extra/eee What's this servername account? You should be using root if you want to preserve root ownership. Mike Hi Mike, That's the admin account name/address on the other laptop. Should it be r...@192.168.15.4? I'm afraid this is all new to me - the remote stuff…. Rob Ignore ownership unchecked on dest. The permissions are changed from readwrite only on System to readwrite on my user account on the receiver. I copied the whole System but the results were the same though some files had permission denied errors. The output on my test folder show nothing remarkable, no errors, etc. Am I missing something here? Any thoughts appreciated or directions to look in. Thanks, Rob delta-transmission enabled recv_files(1) starting recv_generator(audit,1) recv_generator(audit,2) send_files(2, /private/var/audit) audit/ set modtime of audit to (1288417603) Sat Oct 30 01:46:43 2010 recv_generator(audit/20100701144405.20100702030039,3) send_files(3, /private/var/audit/20100701144405.20100702030039) send_files mapped /private/var/audit/20100701144405.20100702030039 of size 21066 calling match_sums /private/var/audit/20100701144405.20100702030039 audit/20100701144405.20100702030039 21066 100%0.00kB/s0:00:00 sending file_sum false_alarms=0 hash_hits=0 matches=0 21066 100%0.00kB/s0:00:00 (xfer#1, to-check=240/242) sender finished /private/var/audit/20100701144405.20100702030039 recv_generator(audit/20100702030127.20100702052825,4) send_files(4, /private/var/audit/20100702030127.20100702052825) send_files mapped /private/var/audit/20100702030127.20100702052825 of size 15417 calling match_sums /private/var/audit/20100702030127.20100702052825 audit/20100702030127.20100702052825 15417 100%7.35MB/s0:00:00 sending file_sum false_alarms=0 hash_hits=0 matches=0 15417 100%7.35MB/s0:00:00 (xfer#2, to-check=239/242) sender finished /private/var/audit/20100702030127.20100702052825 recv_generator(audit/20100702111829.20100703030341,5) send_files(5, /private/var/audit/20100702111829.20100703030341) send_files mapped /private/var/audit/20100702111829.20100703030341 of size 64184 calling match_sums /private/var/audit/20100702111829.20100703030341 audit/20100702111829.20100703030341 ##and later on down the page### generate_files phase=1 recv_files(audit) recv_files(audit/20100701144405.20100702030039) got file_sum set modtime of audit/.20100701144405.20100702030039.U7yt17 to (1278039638) Thu Jul 1 23:00:38 2010 renaming audit/.20100701144405.20100702030039.U7yt17 to audit/20100701144405.20100702030039 recv_files(audit/20100702030127.20100702052825) got file_sum set modtime of audit/.20100702030127.20100702052825.hzHr5M to (1278048505) Fri Jul 2 01:28:25 2010 renaming audit/.20100702030127.20100702052825.hzHr5M to audit/20100702030127.20100702052825 recv_files(audit/20100702111829.20100703030341) got file_sum set modtime of audit/.20100702111829.20100703030341.sSoTwl to (1278126221) Fri Jul 2 23:03:41 2010 renaming audit/.20100702111829.20100703030341.sSoTwl to audit/20100702111829.20100703030341 recv_files(audit/20100703030442.20100703045821) got file_sum --