Advertisement: Linux VPS from $4/month - contact support for custom offer.
-
Administrator
Bash adjusting/editing crontab easily, appending new cronjob
This seems to be easy way to edit Linux Crontab using bash/CLI:
# export current cronjobs to file:
crontab -l > file
# do editing, like replace word search by word replace:
sed -i "s/search/replace/g" file
# import file:
crontab file
How to just add/append new cronjob to crontab. Highlighted text is what is being append.:
echo -e "$(crontab -l 2>/dev/null)\n* * * * * bash $HOME/scripts/script 2&1>/dev/null &" | crontab -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Protected by : ZB
BLOCK & StopForumSpam
Bookmarks