Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a cron job at 2:30 AM everyday

Tags:

cron

crontab

How to configure a cron job to run every night at 2:30? I know how to make it run at 2, but not 2:30.

like image 644
user1856596 Avatar asked Feb 05 '13 14:02

user1856596


People also ask

How do I schedule a cron job daily?

Scheduling a Job For a Specific TimeAdd the below example to execute the specified log backup shell script at 11:00 on every day. We can specify the comma-separated value in a field specifies that the script needs to be executed in all the mentioned time.

How do I set up cron to run a file just once at 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.


2 Answers

crontab -e 

add:

30 2 * * * /your/command 
like image 147
JoG Avatar answered Sep 22 '22 05:09

JoG


  1. To edit:

    crontab -e 
  2. Add this command line:

    30 2 * * * /your/command 
    • Crontab Format:

      MIN HOUR DOM MON DOW CMD

    • Format Meanings and Allowed Value:
    • MIN Minute field 0 to 59
    • HOUR Hour field 0 to 23
    • DOM Day of Month 1-31
    • MON Month field 1-12
    • DOW Day Of Week 0-6
    • CMD Command Any command to be executed.
  3. Restart cron with latest data:

    service crond restart 
like image 35
A.A Avatar answered Sep 23 '22 05:09

A.A