shallow-backup icon indicating copy to clipboard operation
shallow-backup copied to clipboard

Backup crontab file

Open AlexanderProd opened this issue 6 years ago • 6 comments

I thought a backup of the users crontab file would be nice as well. I'll create a PR for it.

AlexanderProd avatar Jan 08 '19 09:01 AlexanderProd

If you want to work on a different crontab related feature after: I explored adding a cronjob for running shallow backup but never got around to it. Should be pretty simple, but still cool.

alichtman avatar Jan 08 '19 09:01 alichtman

Currently i've just added shallow-backup to the crontab file of my mac. Looks like this. 0 20 * * * osascript -e 'tell application "Terminal" to do script "shallow-backup -all"' It opens a terminal window running shallow-backup everyday at 8pm.

But I guess a builtin cron functionality would be nice as well.

AlexanderProd avatar Jan 08 '19 09:01 AlexanderProd

Yeah. There should really be a "Set up cronjob" option in the main menu or something.

alichtman avatar Jan 08 '19 09:01 alichtman

@AlexanderProd Any update on this PR?

alichtman avatar Jul 19 '19 08:07 alichtman

A quick dirty fix of this is adding crontab -l > ~/.config/crontab to the shallow-backup wrapper script (described in the README), and then adding ~/.config/crontab to your list of paths to backup.

alichtman avatar Mar 25 '20 04:03 alichtman

I wasn't sure where to put the crontab output and because I don't think it deserves its own function I'd propose just adding this code to the backup_configs function. After all the crontab is a config too.

command = "crontab -l"
dest = "{}/crontab.txt".format(backup_path)
run_cmd_write_stdout(command, dest)

AlexanderProd avatar Apr 02 '20 10:04 AlexanderProd