SFTP Backup Interval

Started by rkubes, March 17, 2025, 06:10:19 AM

Previous topic - Next topic
Are there any details on the update interval for the SFTP backup?

Since I started using it, I've only had it create backups when I save the configuration of the SFTP plugin itself and it does its self test. I'll later change some other configuration, as I assumed it'd work like the Google Drive backup where it'd create a backup overnight after some configuration change but it doesn't seem to be doing that in my case.

I believe I can create a cron job for the Remote Backup action to schedule a daily backup, but I really only want the backups created after there had been configuration changes.

Does anyone know if the SFTP backup plugin is designed to work that way? If so, what can I look at to see why it may not be triggering? And what time is it supposed to trigger (the documentation for the Google Drive backup just says "early in the morning"). Or if it's not meant to work like that, is there any advice on how I can create a script to look for configuration changes? Just take a hash of the configuration file? Or is there a "last modified" timestamp (I guess from the file system)?

Thanks.

The other builtin backup functions as well as os-git-backup run daily automatically if there have been changes. Even without a user created cron job. I have not used os-sftp-backup, yet.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: rkubes on March 17, 2025, 06:10:19 AMI've only had it create backups when I save the configuration of the SFTP plugin itself and it does its self test. I'll later change some other configuration
It does backups the changes ones a day, checking the crontab in the shell shows that it there is a task for the backup, to run ones a day at 1am + 'random number between 0 and 3600 in seconds'

0 1 * * * (/usr/local/sbin/configctl -d system remote backup 3600) > /dev/null

For me it works as written in the OPNsense doc Traceability of configuration changes using Git and it does apply to SFTP too (at least for me). The backup script iterates through the backup objects and calls backup() for each enabled object.

I did test it by making changes to a firewall rule description and ran the command manually, like

configctl system remote backup 5... and in my case a backup was created in the git and the SFTP target.
Deciso DEC740

Thanks for the info. I just did another test overnight and that one worked. It's possible the other times I tested it that I happened to also update the SFTP settings and the "manual" backup covered what the scheduled backup would have done. I'll keep an eye on it going forward.