Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

cronjob run every hour

#Run a script.sh every hour
0 */1 * * * /usr/local/script.sh
Comment

cronjob set run in every 12 hours

A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.

*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)
* in the value field above means all legal values as in braces for that column.

You could use 0 1,13 * * * which means for every 1AM and 1PM.

0 1,13 * * * rm /var/www/*/somedir/index.php > /home/someuser/cronlogs/some.log 2>&1
where * can be replaced by different domain names.
Comment

PREVIOUS NEXT
Code Example
Shell :: git filter-branch remove file 
Shell :: snap install chrome 
Shell :: find text in files ubuntu 
Shell :: ssh timeout option 
Shell :: git compare branch to another branch changes 
Shell :: chrome ubuntu 
Shell :: how to install gitkraken on fedora 
Shell :: bash concatenate gzipped files 
Shell :: install samba on raspberry pi 
Shell :: install pydotplus by pip ubuntu 
Shell :: reset iis 
Shell :: run powershell script at startup 
Shell :: git remote origin edit 
Shell :: docker-machine create digitalocean 
Shell :: your github oauth token for github.com contains invalid characters 
Shell :: how to push to heroku 
Shell :: typescript detect circular dependency 
Shell :: install react file base64 
Shell :: ubuntu 20.04 uninstall all games 
Shell :: centos show hdd 
Shell :: Error: .ini file does not include supervisorctl section 
Shell :: generate key and certificate openssl 
Shell :: docker compose run 
Shell :: rmdir: failed to remove ‘’: Directory not empty 
Shell :: how to install apple music ubuntu 
Shell :: using github personal github token when cloning a repo 
Shell :: how to install ddos on ubuntu 
Shell :: matlab on ubuntu 
Shell :: git pull with username and password 
Shell :: how to debug wirelessly android 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =