Viewing 1 to 11 of 11 items
Archive | cron RSS feed for this section

Specify PATH Variable in the Crontab

All the above examples we specified absolute path of the Linux command or the shell-script that needs to be executed. For example, instead of specifying /home/ramesh/tape-backup, if you want to just specify tape-backup, then add the path /home/ramesh to the PATH variable in the crontab as shown below. ramesh@dev-db$ crontab -l PATH=/bin:/sbin:/usr/bin:/usr/sbin:/home/ramesh @yearly annual-maintenance */10  Full Article…

0

Installing Crontab From a Cron File

Instead of directly editing the crontab file, you can also add all the entries to a cron-file first. Once you have all thoese entries in the file, you can upload or install them to the cron as shown below. ramesh@dev-db$ crontab -l no crontab for ramesh $ cat cron-file.txt @yearly /home/ramesh/annual-maintenance */10 * * *  Full Article…

0

Schedule a Background Cron Job For Every 10 Minute

Use the following, if you want to check the disk space every 10 minutes. */10 * * * * /home/ramesh/check-disk-space It executes the specified command check-disk-space every 10 minutes through out the year. But you may have a requirement of executing the command only during office hours or vice versa. The above examples shows how  Full Article…

0

Schedule a Job For First Minute of Every Year using @yearly

If you want a job to be executed on the first minute of every year, then you can use the@yearly cron keyword as shown below. This will execute the system annual maintenance using annual-maintenance shell script at 00:00 on Jan 1st for every year. @yearly /home/ramesh/red-hat/bin/annual-maintenance

0

Schedule a Job for Every Minute Using Cron.

Ideally you may not have a requirement to schedule a job every minute. But understanding this example will will help you understand the other examples mentioned below in this article. * * * * * CMD The * means all the possible unit — i.e every minute of every hour through out the year. More  Full Article…

0

Scheduling a Job For a Specific Time

The basic usage of cron is to execute a job in a specific time as shown below. This will execute the Full backup shell script (full-backup) on 10th June 08:30 AM. Please note that the time field uses 24 hours format. So, for 8 AM use 8, and for 8 PM use 20. 30 08 10  Full Article…

0

cron

Cron is a daemon that executes scheduled commands. Cron is started automatically from /etc/init.d on entering multi-user runlevels. Cron searches its spool area (/var/spool/cron/crontabs) for crontab files (which are named after accounts in /etc/passwd); crontabs found are loaded into memory. Note that crontabs in this directory should not be accessed directly – the crontab command should  Full Article…

0

How to Remove a crontab File

Become the root user to remove a crontab file that belongs to root or another user. Roles contain authorizations and privileged commands. You do not need to become root to remove your own crontab file. Remove the crontab file. # crontab -r [username] where username specifies the name of the user’s account for which you want to remove a crontab file. Removing crontab files for another user requires superuser privileges. Caution – If you  Full Article…

0