New answers tagged cron
0
votes
How to schedule a biweekly cronjob?
This variant on date with %U and %V doesn't suffer from the year wraparound errors that they do.
0 0 * * 3 [[ $( expr $(date +%s) / 604800 ) % 2 ) == '0' ]] && echo "execute script"
0
votes
How to have an environment variable with quotes in crontab?
As far as I could find, crontab variables just cannot have quotes and they also can't be more than 999 characters long. The answer to this question is that it's simply not possible.
1
vote
How to have an environment variable with quotes in crontab?
man 5 crontab
An active line in a crontab will be either an environment setting or a cron command. An environment setting is of the form,
name = value
where the spaces around the equal-sign (=) are ...
2
votes
How to have an environment variable with quotes in crontab?
The good practice for cron is:
Create script to run the commands
Set variables in script. Also is possible to use external file with variables: source /path/to/file/with/variables
Use full path to ...
Top 50 recent answers are included
Related Tags
cron × 1957linux × 519
ubuntu × 226
bash × 186
centos × 153
php × 142
debian × 102
email × 84
shell × 69
unix × 61
scripting × 58
backup × 57
mysql × 48
ssh × 44
logging × 44
rsync × 39
shell-scripting × 37
logrotate × 37
python × 35
scheduled-task × 34
apache-2.2 × 33
permissions × 32
redhat × 31
amazon-web-services × 30
centos7 × 30