how to add a cron job through ssh command crontab -e

The fields in cron are:
m      h       dom             mon     dow          command
Minute Hour    Day of Month    Month   Day of week  <command>
And your 0 * * * * <command> then translates to "Execute command on every hour, every day, every month, and every weekday, if the minute is 0"
You can list your crontab by using crontab -l, as delh already stated.

By default cron searches its spool area /var/spool/cron/ directory for crontab files. All files which are named after username i.e. accounts in /etc/passwd file. So if your username is

vivek, crontab file location should be /var/spool/cron/$USER i.e. /var/spool/cron/vivek. Note that cron in this directory should not be accessed directly - the crontab command should be used to access and update them as follows:
crontab -e
To view your crontab file (cron jobs) type:
crontab -l

Post a Comment

0 Comments