![]() You do not need to restart your crond service for the new changes. # echo "0 0 * * * rm -f /tmp/deepak/*" > /var/spool/cron/deepak To give a demonstration I will schedule a job to clear temporary files every midnight for both the user # echo "0 0 * * * rm -f /tmp/root/*" > /var/spool/cron/root # /usr/bin/crontab /var/spool/cron/deepak For the sake of this article I will create some sample cron job for root and deepak user, so I will assign permission for these two users.Īppend the username to /etc/cron.allow # cat /etc/cron.allowĬreate a cron file for root user # touch /var/spool/cron/rootĬreate a cron file for deepak user # touch /var/spool/cron/deepak Steps to create cron job manually Step 1: Give crontab privilegeīefore we start we need to give crontab privilege to the respective user. Schedule cron job via crontab using shell script with examples. How to update crond using a shell script? Setting up cron job using command line bash shell script in Linux? Create cron job automatically for root user and normal user using script in Linux. In my last article I had shared the steps to downgrade rpm to a specific old version in Linux and Unix.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |