Open a-pav opened 2 years ago
I think the easiest way to solve this will be to add a "start between x and x hours" or "don't start between x and x hours" to solve most problems.
@axellpadilla That's not terribly different from how Timeshift currently works, and it doesn't help at all in scenarios like wanting to take a snapshot on every third day of the week, for example.
Meanwhile in order to take a snapshot on every third day of the week, I came up with simple a solution.
Since /etc/cron.d/timeshift-hourly
is created by Timeshift, I created a cron job to delete it on an hourly basis to ensure it doesn't exist:
59 * * * * root rm -f /etc/cron.d/timeshift-hourly
Then I created my own custom cron job for taking snapshots:
0 8,12,16,20 * * sat,mon,wed root timeshift --check --scripted
And in GUI > Settings > Schedule, Daily is selected.
Basically, with /etc/cron.d/timeshift-hourly
file being removed, one can write any custom schedule they like, utilizing cron job, --check
flag and some tweak made to timeshift's Schedule settings.
You are right, while first option is the easiest (coding less, solving most problems of execution at not desired times), it doesn't completely fix it. Next on line user-oriented, could but to just add a textbox where to type cron times on the GUI, all problems solved. The perfect one would be obviously to add full GUI configurable options.
Is your feature request related to a problem? Please describe.
If a user wants to create their own custom schedule, they're advised to disable all the predefined schedules, and create their own cron job. But disabling all predefined schedules makes
--check
useless, running it in such case says thatScheduled snapshots are disabled - Nothing to do!
This is where things get inflexible.--check
can be of great help in manual commands and specially custom cron jobs. Using it means avoiding creation of unnecessary snapshots, which in turn means 1) no unnecessary interruption of user's workflow and 2) no unnecessary deletion of old (but possibly still valid and useful) snapshots because of exceeding the number ofKeep
.An alternative option is to not disable (all) the predefined schedules, and then edit the
timeshift-hourly
file in/etc/cron.d
directory. But this is not a viable option, astimeshift-hourly
can be overwritten by timeshift without user's knowledge.Describe the solution you'd like
I would like to be able to use the goodies of
--check
. And I think the easiest way to make this happen is to introduce a new check box in 'Settings > Schedule tab' like below:timeshift can keep creating and maintaining the
timeshif-hourly
file as long as the above checkbox is NOT selected by user.Describe alternatives you've considered Don't know.
Additional context
I wanted to create a cron job to take system snapshots on every third day of the week, and also minimize the chance of having 'missed snapshots' and etc.