how to automate aptik backup as cron job

Asked by Ian W Scott

I would like aptik to run (from the command line). So far I have this in my crontab:

 23 20 * * * root cd /home/ian/Dropbox/Apps/aptik/ && aptik --backup-all

My questions are:

1. Since the cli requires that I provide a password for backing up some settings, is there any way to provide the password as a variable in the command so that the script can run unattended?

2. Is there any way to specify the user whose settings are being backed up? Since I'm running aptik as root it won't automatically know which user I want.

Thanks,

Ian

Question information

Language:
English Edit question
Status:
Solved
For:
Aptik Edit question
Assignee:
No assignee Edit question
Solved by:
Ian W Scott
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Ian W Scott (iscott) said :
#2

I've answered my own question now by looking more carefully at the documentation. I believe the following should work (in my root crontab, not specifying 'root' in the command itself):

 23 20 * * * cd /home/ian/Dropbox/Apps/aptik/ && aptik --backup-all --user <myusername> --password <mypassword> --yes >> ./aptik_cron.log 2>&1

Please let me know if you see any problem here.

Thanks.

Ian

Revision history for this message
Ian W Scott (iscott) said :
#3

Minor fix to my revised cron command.