Easiest and Quickest way / tutorial to learn cronjob in ubuntu

Cron is a system daemon used to execute desired tasks (in the background) at designated times. I am demonstrating most simple form of cronjob in ubuntu.

  1. Open terminal and enter the following command:crontab -e
  2. Enter following line of code: 34 09 * * * env DISPLAY=:0 gedit
  3. Save this settings

Description: Here 34 represents minute, 09 represents hour and *,* and * are for every day, month and weekdays and * represents always. This will open text editor on 9 am and 34 minutes everyday, every month and every weekdays. Change 34 and 09 to your nearest upcomming time. For eg if your current time is 10:20 AM then change 34 to 24. So that you can see result within few minutes. So your modified command will look like this 24 10 * * * env DISPLAY=:0 gedit. Command env DISPLAY=:0 is for displaying gui programs like gedit. You can replace gedit with skype or any programs you like. crontab -e command is for editing the existing cron jobs. To check your existing cron job hit crontab -l in the terminal.

About the Author

has written 31 stories on this site.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

*

Copyright © 2017 Programmer to Programmer- A website for web programming and mobile application programming tutorials.
Wordpress themes