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

Re: Should I keep all archives



Hi,

I ended up using https://github.com/alexjurkiewicz/acts/ with the following config:

dailybackups=30
monthlybackups=6
yearlybackups=3

I think it's reasonable because tarsnap is not expensive and now I have a fixed number of archives.

Thank you for all your valuable inputs.

Regards
Romu

On 2021/6/28 9:38, Michael Sierchio wrote:

I used to adhere to the following discipline.  I don't know if this is useful to you. 

Run tarsnap daily.  Each archive created is tagged as one of the following:

daily-<filesystem>-YYYYMMDDTHHMMSSZ
weekly-<filesystem>-YYYYMMDDTHHMMSSZ
monthly-<filesystem>-YYYYMMDDTHHMMSSZ


is it the last day of the month?  [ "`date -v+1d +%d`" = "1"]
    create monthly archive
    delete all but the N most recent monthly archives

else is it the last day of the week?   [ "`date -v+1d +%u`" = "1"]
    create weekly archive
    delete all but the M most recent weekly archives

else
    create daily archive
    delete all but the J most recent daily archives

  

weekly are taken the last day of the week (Sat or Sun, dep. on your locale) – monthly are taken on the last day of every month

On Sun, Jun 27, 2021 at 2:12 PM james young <pronoiac@gmail.com> wrote:
I could be off-base, but I think keeping a lot of extra archives around leads to slower archive listing, fsck / cache directory resyncing and reconstruction, and restores? 

Mac Time Machine backup defaults: 24 hourly, 30 daily, then as many weekly backups as space allows. 
My config for tarsnap-cron: 7 daily backups, 5 weekly, 12 monthly. 

It's my personal opinion, but a month is a nice buffer. Three days is shorter than some holiday weekends, not to mention vacations. 

In your place, I'd think about switching to one of the helper scripts mentioned in another reply. See if it can work with the archive names as they are now. You can copy archives if you want to fit a new archive naming scheme ( https://www.tarsnap.com/tips.html#copy-archive ). Or, if you're sure you want to stick to the last three days/one month/whatever and YOLO, wait that long, verify the backups, then delete archives from the old method ( https://www.tarsnap.com/improve-speed.html#faster-delete ).

-James 

Sent from my iPad

On Jun 26, 2021, at 3:26 PM, Romo Hu <huruomu@gmail.com> wrote:

Hi,

My system has a daily cron job that does tarsnap backup which has been running since 2017, and "tarsnap --list-archives" shows a lot of archives.  Should I care?  Is it ok to just let the archive number keep growing?  If there will never be a need to restore data that are more than 3 days old, can I just remove all archives that are more than 3 days old?  Is it possible to configure tarsnap to only keep archives of the recent 3 days?

Regards
Romu


--

"Well," Brahmā said, "even after ten thousand explanations, a fool is no wiser, but an intelligent person requires only two thousand five hundred."

- The Mahābhārata