Since we know our backup script works, we can schedule it to run daily.
The first backup can take a long time to finish depending on the amount of data to be processed.
The following backups should be a lot faster since changes will be incremental and take advantage of deduplication for snapshots.
I made some changes to the original script:
Used a lock file to make sure multiple backups don’t run at the same time
I did not directly schedule this script, the reason is given in the note below
I noticed that the gitlab backup spawned a question and required an interaction (a "y" answer) for the backup to proceed.
I looked into the
yunohost backup --help with no luck.
I tried some tricks using the yes command or a basic piped
echo "y", nothing worked.
Since I want a totally unattented backup script I had to use the expect program to answer this question for me.
This has the advantage of being able to select which question I want to answer.
Note that this question is whether you are okay with taking a little more space temporarily to make the backup.
This could be a problem in a low space environment.
This will launch the backup script and automatically answer "y" when prompted.