Rsnapshot manual rotation delete daily folders

  • Hi,

    I setup my rsnapshot rotation manually using linux cron service.

    I do this setup

    05 * * * * /share/CACHEDEV1_DATA/.qpkg/Entware-3x/bin/rsnapshot hourly

    35 1 * * * /share/CACHEDEV1_DATA/.qpkg/Entware-3x/bin/rsnapshot daily

    35 2 * * 7 /share/CACHEDEV1_DATA/.qpkg/Entware-3x/bin/rsnapshot weekly

    35 3 01 * * /share/CACHEDEV1_DATA/.qpkg/Entware-3x/bin/rsnapshot monthly


    Sometimes the hourly task delete the last daily folder.

    Then calling the daily task it is created again.

    Someone can help me?


    Thanks!

  • I don't use an hourly step, but assuming you have configured for something similar to (note: these must be in this order):

    Code
    retain hourly 24
    retain daily 7
    retain weekly 4
    retain monthly 3

    and that sufficient time has passed that all snapshots have been taken, then:

    - on the hour: hourly.23 is deleted, and all other hourly snapshots are moved up (22->23, etc), then a new snapshot hourly.0 is created

    - on the day: daily.6 is deleted, and all other daily snapshots are moved up (5->6, etc), then snapshot hourly.6 is moved to daily.0 Note: hourly.6 is missing and will be created on the next hourly.


    The weekly and monthly are similar. The "missing" daily snapshot should be the result of the weekly snapshot being taken, not the hourly one.


    This is a log output of my weekly snapshot:


  • Thank you doscott.

    I set the rsnapshot.conf exactly has you said:

    Code
    retain hourly 24
    retain daily 7
    retain weekly 4
    retain monthly 2

    Is possible that I wrong the cron execution?

    because if you look the crontab setup:

    Code
    05 * * * * /share/CACHEDEV1_DATA/.qpkg/Entware-3x/bin/rsnapshot hourly
    35 1 * * * /share/CACHEDEV1_DATA/.qpkg/Entware-3x/bin/rsnapshot daily
    35 2 * * 7 /share/CACHEDEV1_DATA/.qpkg/Entware-3x/bin/rsnapshot weekly
    35 3 01 * * /share/CACHEDEV1_DATA/.qpkg/Entware-3x/bin/rsnapshot monthly

    This night, that is monday it works so:

    at 01:05 => rsnapshot hourly
    at 01:35 => rsnapshot daily

    at 02:05 => rsnapshot hourly
    at 02:35 => rsnapshot weekly
    at 03:05 => rsnapshot hourly

    Is it possible that 30 minutes are not enough to finish the daily task, and at 02:05 it starts the hourly task while is active the daily task and this is the trouble cause?

    If this is the reason, can I setup with

    Code
    retain hourly 12

    and schedule the cron with a longer period between hourly, daily, weekly and monthly?


    Thank you very much for your time

  • I think see what is going on now. You should schedule the tasks so that:

    monthly starts before weekly

    weekly starts before daily

    daily starts before hourly


    You shouldn't need a lot of time between the monthly, weekly, daily and hourly tasks as they are mostly just moving folders, with the longest operation being the deleting of a folder in the monthly task.


    Maybe do hourly at minute 45

    daily at minute 35 hour 0

    weekly at minute 25 hour 0

    monthly at minute 5 hour 0

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!