Dan Crosta
2005-Nov-16 23:28 UTC
list files to delete, rather than deleting them with --delete?
I'm trying to design a daily backup system based on rsync that will keep deleted files for N days after they went missing, and am wondering if there's a way I can coax rsync to give me a list of files that are missing on the source relative to the destination, so that they can be later deleted (ie after the N days). I envision a system like this: rsync [args] --list-of-missing=FilesToDelete [src] [dest] and then process ToDelete like so (supposing N is 3): 1. mv ToDelete-2 ToDelete-3 && mv ToDelete-1 ToDelete-2 2. cat ToDelete | grep -vf ToDelete-2 -f ToDelete-3 > ToDelete-1 3. delete from dest files mentioned in ToDelete-3 4. rm ToDelete-3 So I realize I can use --dry-run and --delete, and capture and parse the output of rsync, but then I've spent a whole lot of time building file lists and pretending to transfer files (or maybe even doing all the checksumming and whatnot -- does --dry-run still do all that?), and then I need to do it again to actually do the backup. The backup runs about 60 gigs, and takes around an hour to do once (for the incremental backups -- the inital takes quite a bit longer), so I'd rather not have the system do it twice, if avoidable. Is there any way to make this work? Or am I barking up the wrong tree with rsync for this kind of backup scheme? Or is there another way to accomplish the same goal (keeping deleted files from src in dest for N days)? Thanks, dsc
Christoph Biedl
2005-Nov-17 00:43 UTC
list files to delete, rather than deleting them with --delete?
Dan Crosta wrote...> Is there any way to make this work?What I'm doing: rsync (several options) --delete --backup \ --backup-dir=(absolute path out of $dest) \ $src $dest and backup-dir gets archived afterwards. In your case you'd rename it to represent the last days' changes. Christoph
Reasonably Related Threads
- help with time data - R weird behaviour across machines
- [Bug 2139] New: re-exec fallback problem
- Question about setting field values for a belongs_to model
- sangoma 102 and CAB-E1-RJ45BNC
- FreeBSD samba server returns nt_status_acces_denied when DosStream xattr larger than 64KB