Changes

Jump to navigation Jump to search
970 bytes added ,  22:26, 6 October 2015
Line 4: Line 4:  
= Description =
 
= Description =
 
How to automatically run a command periodically with Cron daemon.
 
How to automatically run a command periodically with Cron daemon.
 +
 +
Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading email.
 +
[http://en.wikipedia.org/wiki/Cron From Wikipedia]
 +
 +
Cron daemon is the Unix and GNU/Linux equivalent to Scheduled Tasks in Windows.
    
= Custom template =
 
= Custom template =
Line 10: Line 15:  
Custom templates survive updates and are included in a regular backup.
 
Custom templates survive updates and are included in a regular backup.
   −
Make directory for custom template
+
Check for a custom template directory. If one doesn't exist, make the directory for custom template with the following command
    
  mkdir -p /etc/e-smith/templates-custom/etc/crontab
 
  mkdir -p /etc/e-smith/templates-custom/etc/crontab
Line 23: Line 28:  
  00 16 * * * root /root/cronjobs/external_ip.sh
 
  00 16 * * * root /root/cronjobs/external_ip.sh
   −
Syntax: (0-59) (0-23) (1-31) (1-12 or Jan-Dec) (0-6 or Sun-Sat) (user) (command)
+
Syntax: Minute(0-59) Hour(0-23) Day(1-31) Month(1-12 or Jan-Dec) Day of Week(0-6 or Sun-Sat) (user) (command)
 +
 
 +
The asterisk (*) is a wildcard entry meaning all. If you enter day, you have to enter month. To run something once a week, put * for day and month and enter a number for the day.
    
Save and exit.
 
Save and exit.
Line 52: Line 59:     
A script fired by a cron entry must be executable.
 
A script fired by a cron entry must be executable.
 +
 +
= Contribs=
 +
[http://wiki.contribs.org/Crontab_Manager Crontab Manager] is a contribs which is able to do automatically what is needed above.
    
= Links =
 
= Links =
[http://forums.contribs.org/index.php?topic=29433.0 Forum post 1]
+
[http://forums.contribs.org/index.php?topic=29433.0 Forum post 1] | [http://forums.contribs.org/index.php?topic=43577.0 Forum post 2]
| [http://forums.contribs.org/index.php?topic=43577.0 Forum post 2]
      
[http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual#Configuration_file_templates Developers Manual on Configuration file templates]
 
[http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual#Configuration_file_templates Developers Manual on Configuration file templates]
70

edits

Navigation menu