Handle secret info with: this
- Set the script to be executable -
chmod 744 ~/codes/dotfiles/backup_dotfiles.sh
- Open crontab
crontab -e
- Add
0 9 * * MON cd ~/codes/dotfiles && ./backup_dotfiles.sh
to run the backup_dotfiles script on Monday at 9 am.
- See Crontab.guru.
I had to define the PATH
for crontab, which I did with this script which I found in this stack overflow.
I also had to make sure that the git repo was set up with SSH, which I did with help from this gist
But, now everything works like a charm.