What I want to do is use rsync to back up a folder to an external drive. I would like to keep 30 days worth. For example: I have backups of June 1 - June 30. Once July 1 comes along, I want to keep June 2 - July 1 and delete June 1, and so forth. Any ideas how I can accomplish this? -- View this message in context: http://www.nabble.com/Rysnc-Schedule-tf4104577.html#a11672997 Sent from the Samba - rsync mailing list archive at Nabble.com.
On 7/18/07, sparty2809 <sparty2809@yahoo.com> wrote:> What I want to do is use rsync to back up a folder to an external drive. > > I would like to keep 30 days worth. > > For example: I have backups of June 1 - June 30. Once July 1 comes along, I > want to keep June 2 - July 1 and delete June 1, and so forth. > > Any ideas how I can accomplish this?You can do this very easily with rsnapshot ( http://www.rsnapshot.org/ ), a backup program built around rsync. It manages a rotating set of snapshots that all appear to be full, but unchanged files are hard-linked from one snapshot to the next to save storage. You would configure it with a single backup point and a single interval, "daily", with 30 snapshots. If space on the external disk is an issue, you could use rdiff-backup ( http://www.nongnu.org/rdiff-backup/ ) instead. It represents old versions of a file using a chain of backward deltas instead of full copies. Matt
On Wed, 18 Jul 2007, sparty2809 wrote:> > What I want to do is use rsync to back up a folder to an external drive. > > I would like to keep 30 days worth. > > For example: I have backups of June 1 - June 30. Once July 1 comes > along, I want to keep June 2 - July 1 and delete June 1, and so forth. > > Any ideas how I can accomplish this?Do the backups with rsync and write a shell script that runs every night that deletes the 31st (and greater) backup. ..Chuck.. -- http://www.quantumlinux.com Quantum Linux Laboratories, LLC. ACCELERATING Business with Open Technology "The measure of the restoration lies in the extent to which we apply social values more noble than mere monetary profit." - FDR 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
I understand how to do the rsync part, but how would I delete the files? Chuck Wolber wrote:> > On Wed, 18 Jul 2007, sparty2809 wrote: > >> >> What I want to do is use rsync to back up a folder to an external drive. >> >> I would like to keep 30 days worth. >> >> For example: I have backups of June 1 - June 30. Once July 1 comes >> along, I want to keep June 2 - July 1 and delete June 1, and so forth. >> >> Any ideas how I can accomplish this? > > Do the backups with rsync and write a shell script that runs every night > that deletes the 31st (and greater) backup. > > ..Chuck.. > > > -- > http://www.quantumlinux.com > Quantum Linux Laboratories, LLC. > ACCELERATING Business with Open Technology > > "The measure of the restoration lies in the extent to which we apply > social values more noble than mere monetary profit." - FDR > > 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 > -- > To unsubscribe or change options: > https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html > >-- View this message in context: http://www.nabble.com/Rysnc-Schedule-tf4104577.html#a11678999 Sent from the Samba - rsync mailing list archive at Nabble.com.
On 7/18/07, Charles Marcus <CMarcus@media-brokers.com> wrote:> Is there an alternate way to remove an entire directory *without* > traversing the directory itself?No filesystem that I know of provides one, although it would be great to be able to issue a single unlink or rmdir call and have the filesystem traverse the directory and free its insides in the background. Matt
> On 7/18/2007, Chuck Wolber (chuckw@quantumlinux.com) wrote: > > In linux, you delete files with the "rm" command... > > OT follow-up... > > Is there an alternate way to remove an entire directory *without* > traversing the directory itself?I just use rmdir under Windows. Also Windows users can use : FORFILES [/P pathname] [/M searchmask] [/S] [/C command] [/D [+ | -] {dd/MM/yyyy | dd}] Description: Selects a file (or set of files) and executes a command on that file. This is helpful for batch jobs. for example: set drive=E:\ forfiles /p %drive%:\ /m * /D -30 /C "cmd /c if @isdir==TRUE ECHO @PATH>> C:\list.tmp" This lists directories over 30 days old into a file. I make the script delete the old directories and it loops until there is no old directories left. This email is the property of ECS Technology Ltd. This company is registered in Scotland with company number 212513. VAT registered GB 761 7456 12 http://www.ecs-tech.com/
On 7/19/07, Chris <sparty2809@yahoo.com> wrote:> Never used it before. Does it have a gui?No. You edit the configuration file /etc/rsnapshot.conf and then run rsnapshot from the command line with the name of the backup interval, like "rsnapshot daily". Please don't be put off by having to edit a configuration file yourself; it's pretty straightforward. Just go through and replace the samples with the paths and settings that you want to use. There are plenty of comments to guide you. Matt
On Wed, Jul 18, 2007 at 08:45:28PM -0400, Matt McCutchen wrote:> On 7/18/07, Charles Marcus <CMarcus@media-brokers.com> wrote: > >Is there an alternate way to remove an entire directory *without* > >traversing the directory itself? > > No filesystem that I know of provides one, although it would be great > to be able to issue a single unlink or rmdir call and have the > filesystem traverse the directory and free its insides in the > background.You may also wish to consider dirvish at www.dirvish.org . It is a scheduling wrapper around rsync, and includes an expire utility. Keith -- Keith Lofstrom keithl@keithl.com Voice (503)-520-1993 KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon" Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs
On 7/19/07, Chris <sparty2809@yahoo.com> wrote:> I know how to use the command prompt, was just curious if it had a gui.OK. Please don't take any offense at my offering a little extra support in case you were a user who needed it.> So this can backup for 30 days and once 30 days comes up, it will delete the > 1st day and add the 31st?Yes. Just set a backup interval of "daily" with 30 snapshots in the configuration file. If you like, you can also add other intervals, e.g., weekly snapshots for the past 10 weeks. Matt