Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup crontab file #215

Open
AlexanderProd opened this issue Jan 8, 2019 · 6 comments
Open

Backup crontab file #215

AlexanderProd opened this issue Jan 8, 2019 · 6 comments
Labels

Comments

@AlexanderProd
Copy link
Contributor

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

@alichtman
Copy link
Owner

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.

@AlexanderProd
Copy link
Contributor Author

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.

@alichtman
Copy link
Owner

alichtman commented Jan 8, 2019

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

@alichtman
Copy link
Owner

@AlexanderProd Any update on this PR?

@alichtman
Copy link
Owner

alichtman commented Mar 25, 2020

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.

@AlexanderProd
Copy link
Contributor Author

AlexanderProd commented Apr 2, 2020

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants