Allow interval per source to be overwritten to 0 to skip the source in this interval. #2
Loading…
Reference in a new issue
No description provided.
Delete branch "skybeam/ccollect:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This change allows to overwrite an interval to 0 for a specific source in order to skip it for this interval.
This is useful if you have default intervals configured and you would like to skip certain sources for specific intervals.
@ -766,3 +766,3 @@
_exit_err "Listing oldest backup failed")
_techo "Using ${oldest_bak} for destination dir ${destination_dir}"
if mv "${oldest_bak}" "${destination_dir}"; then
if mv "${oldest_bak}" "${destination_dir}" 2>/dev/null; then
Why skip potential error messages?
Because oldest_bak can be empty and this causing mv to spit an error - which is OK as we are only interested in the return code telling us if the move was successful. In this case the failed move is expected. No need for an error message.
@ -780,3 +780,3 @@
_techo "Removing ${remove} backup(s)..."
if [ -z "${ls_rm_exclude}" ]; then
if [ -z "${ls_rm_exclude}" -o ${c_interval} -le 0 ]; then
If we want to match 0, we should do
-eq 0
, otherwise the documentation will need to be adjusted.Fine with me, usually errors are positive integers and I learned never ever to match numbers with "eq" - but for integers here it might be ok, so feel free to use -eq.
@ -796,0 +796,4 @@
#
# Skip backup of this source if interval is zero.
#
if [ ${c_interval} -le 0 ]; then
Same here
I think overall the idea is not bad, I'd recommend to go with
-eq 0
and we would also need to document the behaviour, not only implement it.I did have a very quick look at the code only. Not sure if it is not ideal at all, but I am definitely missing an option to disable an interval for certain sources.
I typically have daily, weekly, monthly and yearly intervals, but for some sources I don't want to have daily as weekly is far sufficient. So there would be only the option to not define the intervals in the defaults but this leaving me to require defining the intervals in all other sources. Would be much easier to be able to override an interval to 0 to disable it for a certain source.
I think overall the idea is not bad, I'd recommend to go with
-eq 0
and we would also need to document the behaviour, not only implement it.Did some update to the documentation as well.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.