HomeEvergreen: Basic System Admin FunctionsHousekeepingQuickly Update Crontab for Restart

4.2. Quickly Update Crontab for Restart

In order to quickly comment out the crontab for restarts, open crontab with vim as root and type the following:

crontab -u opensrf -e

This opens the crontab for editing. Once within vim, type the following:

:%s/^/###/g

This tells vim that you want to replace every escape sequence with a triple pound sign, thus commenting out the crontab so random scheduled scripts don't start while you are re-starting and muck everything up.

To save the fine work you've just performed, type :wq [enter]

Change to the opensrf user and perform your restart. Exit back to root.

Go back into crontab:

crontab -u opensrf -e

This opens the crontab again for editing. Once within vim, type the following:

:%s/###//g

Notice that you are removing the pounds and making everything normal again.

Save it again with :wq [enter]

Keep in mind that every time a crontab is edited, the crontab is instantly reloaded.

This page was: Helpful | Not Helpful