LoginSignup
0
1

More than 5 years have passed since last update.

How to restore crontab with git

Posted at

Reference

How to git add crontab


# cd /var/spool/cron

# git init
Initialized empty Git repository in /var/spool/cron/.git/

# git add *

# git commit -m "20180119"
[master (root-commit) 6d7b375] 20180119
 Committer: root <root@>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 2 files changed, 6 insertions(+)
 create mode 100644 
 create mode 100644 root

How to restore

# git reset --hard HEAD
HEAD is now at 6d7b375 20180119
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1