[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to manage backups with Tarsnap -



On Sun, Jan 24, 2010 at 04:06:50PM -0800, Craig Carl wrote:
> All - 	
> 	I don't know if this will be helpful to anyone else but I needed a
> script to delete old backups and manage my snapshots so I wrote this
> -
> 
> http://github.com/Gestas/Tarsnap-generations
> 
> 	Some more details are below. I'm still testing so be aware that you
> may need to check back for a newer version soon, but this seems to
> be working for now. If you would like to see something added or
> changed please let me know and I will get to it when I can.

Nice script, but I just ran into a bug with it.

When creating the "first" backup, and it happens to take longer than an
hour, the backups it creates are deleted right after creating it.

I ran:
	./tarsnap-generations.sh -f ./tarsnap.folders -h 1 -d 10 -w 4 -m 2

and it did the following:

Starting HOURLY backups...
tarsnap: Removing leading '/' from member names
                                       Total size  Compressed size
All archives                                20 GB            20 GB
  (unique data)                            4.3 GB           4.3 GB
This archive                               4.2 GB           4.2 GB
New data                                   2.5 kB           3.1 kB
20100202-12-HOURLY-aria-/home/greg/git/ backup done.
tarsnap: Removing leading '/' from member names
                                       Total size  Compressed size
All archives                                23 GB            23 GB
  (unique data)                            6.4 GB           6.3 GB
This archive                               2.6 GB           2.4 GB
New data                                   2.1 GB           2.0 GB
20100202-12-HOURLY-aria-/home/greg/backup/ backup done.
Verifying backups, please wait.
20100202-12-HOURLY-aria-/home/greg/git/ backup OK.
20100202-12-HOURLY-aria-/home/greg/backup/ backup OK.
Finding backups to be deleted.
                                       Total size  Compressed size
All archives                                20 GB            20 GB
  (unique data)                            4.3 GB           4.3 GB
This archive                               2.6 GB           2.4 GB
Deleted data                               2.1 GB           2.0 GB
20100202-12-HOURLY-aria-/home/greg/backup/ snapshot deleted.
                                       Total size  Compressed size
All archives                                16 GB            16 GB
  (unique data)                            4.3 GB           4.3 GB
This archive                               4.2 GB           4.2 GB
Deleted data                               2.5 kB           3.1 kB
20100202-12-HOURLY-aria-/home/greg/git/ snapshot deleted.
./tarsnap-generations.sh done


Yes, the "backup" snapshot was the first time I had pushed data out to tarsnap
for that subdirectory, and it took about 3 hours to push 2.0 GB (slow upstream
connection)

But now I need to do it again, "by hand" as an initial "seed" backup so
as to not have this happen again...

Hope this doesn't hit anyone else, to save them the bandwidth charges :)

thanks,

greg k-h