Good day, my old friends!
I make a server postinstall script that copies my config files and all... I want to create an empty crontab for root if needed. My solution is very awkward. Here is it:If you have any idea how to handle it in a more civilized way - please tell me! Thank you in advance!Code:createCrontab() { if [ ! -f /var/spool/cron/crontabs/root ]; then sudo EDITOR=vi crontab -e 2>/dev/null <<END-OF-INPUT :g/hello/s//bye/g :w :q! END-OF-INPUT fi }
Bookmarks