Portal Home > Knowledgebase > VPS Hosting and Dedicated Servers > How to edit crontab in Ubuntu


How to edit crontab in Ubuntu




For more detail information,you can

man crontab

Use crontab

To open crontab

crontab -e

If you need to run commands with administrative privileges

sudo crontab -e

Open crontab with your favorite editor.(By default it’s vi or will let you choose one from list)

export EDITOR=gedit
 
crontab -e

You can append “export EDITOR=gedit” to your ~/.bashrc file if necessary.

To list crontab content

crontab -l

To remove all your cron jobs

crontab -r

 

Crontab syntax

*    *    *    *    *  command to be executed
┬    ┬    ┬    ┬    ┬
│    │    │    │    │
│    │    │    │    │
│    │    │    │    └───── day of week (0 - 6) (0 is Sunday, or use names)
│    │    │    └────────── month (1 - 12)
│    │    └─────────────── day of month (1 - 31)
│    └──────────────────── hour (0 - 23)
└───────────────────────── min (0 - 59)


Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Buy web hosting with SMS (Views: 7286)

* Minimum sign up periods for cPanel Web Hosting plans: Mini - 3mo., Pro - 1mo., Biz - 1mo., cPanel Reseller Hosting, Linux VPS, Windows VPS, Managed cPanel VPS and Dedicated Servers - 1mo. secret link
Accepted payments: Credit/Debit Card, Paypal, Payza, Skrill, WebMoney, CashU, Ukash, paysafecard, Bitcoin, Perfect Money, SolidTrust Pay, OKPay, EgoPay, Western Union/MG, Wire Transfer and more.