Skip to content

Automating running of backups

In this section, systemd and cron ways are going to be explained. systemd is the preferred way in case your system has it.

It is supposed you already have configured the environment and it works.

For both ways, download the file in some place. In this example, the same folder, where the venv, configuration and steps are located, is going to be used.

curl -sSL >
chmod +x


For systemd, you need to download backups.service and backups.timer, copy them to /etc/systemd/system and enable the timer.

sudo bash -c "curl -sSL > /etc/systemd/system/backups.service"
sudo bash -c "curl -sSL > /etc/systemd/system/backups.timer"
sudo nano /etc/systemd/system/backups.service #Modify the path to the script !!
sudo nano /etc/systemd/system/backups.timer #Check when the timer is going to fire !!
sudo systemctl enable backups.timer
sudo systemctl start backups.timer
nano #Modify the path of CONFIG_FOLDER

You must modify the path to the script in the backups.service and the CONFIG_FOLDER in the It is recommended to check if you like when the timer is going to fire (by default is every night at 1am).


For crontab, you need to edit the roots crontab and add a new entry. Also modify the file to remove the comment in the last line to have logs visible in the same folder where the configuration and steps are placed. An example of crontab entry could be:

0 1 * * * /backups/tool/