Posts

Showing posts from March 4, 2011

schedule tasks on linux using crontab

If you've got a website that's heavy on your web server, you might want to run some processes like generating thumbnails or enriching data in the background. This way it can not interfere with the user interface. Linux has a great program for this called cron. It allows tasks to be automatically run in the background at regular intervals. You could also use it to automatically create backups, synchronize files, schedule updates, and much more. Welcome to the wonderful world of crontab. Crontab The crontab (cron derives from chronos , Greek for time; tab stands for table ) command, found in Unix and Unix-like operating systems, is used to schedule commands to be executed periodically. To see what crontabs are currently running on your system, you can open a terminal and run: sudo crontab -l To edit the list of cronjobs you can run: sudo crontab -e This wil open a the default editor (could be vi or pico, if you want you can change the default editor) to let us manipu