17 * * * * root cd / && run-parts --report /etc/cron.hourly
Every hour, at xx:17, CRON fires run-parts to run anything executable within /etc/cron.hourly.
run-parts is a little picky and will purely ignore files with names containing "forbidden" characters. The dot .
is on the blacklist
Full list and details : man run-parts
@hourly crontab jobs | /etc/cron.hourly/jobName jobs | |
---|---|---|
Ownership | Each user has a personal crontab, so such jobs can be set by everybody | Requires write access in /etc/cron.hourly/, so root only |
Execution time |
@hourly is an alias for 0 * * * * : commands are started at hh:00(details : man 5 crontab) |
grep hourly /etc/crontab
17 * * * * root cd / && run-parts --report /etc/cron.hourlyBy default : at hh:17 on Debian Jessie |
cat /etc/crontab
# m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly this is executed as-is 25 6 * * * root test -x /usr/sbin/anacron || (cd / && run-parts --report /etc/cron.daily) this is executed only if anacron is not installed 47 6 * * 7 root test -x /usr/sbin/anacron || (cd / && run-parts --report /etc/cron.weekly) this is executed only if anacron is not installed 52 6 1 * * root test -x /usr/sbin/anacron || (cd / && run-parts --report /etc/cron.monthly) this is executed only if anacron is not installed
If anacron is installed, cron delegates the running of aliased jobs :
grep 'anacron start' /etc/cron.d/anacron
30 7 * * * root test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start >/dev/nullEvery day, at 7:30AM, cron fires anacron (which is not a daemon since it dies after doing its daily duty). The /etc/init.d/anacron script is used to :
anacron itself is controlled via /etc/anacrontab :
cat /etc/anacrontab
# These replace cron's entries 1 5 cron.daily run-parts - -report /etc/cron.daily 7 10 cron.weekly run-parts - -report /etc/cron.weekly @monthly 15 cron.monthly run-parts - -report /etc/cron.monthly
So, every day at 7:30AM, cron wakes anacron up. anacron waits an extra 5 minutes, then starts daily jobs : it's 7:35AM !
It is fairly easy to get the current time of any zone. Time zones are listed in /usr/share/zoneinfo :
The current timezone is defined in :
zdump Europe/Paris; zdump Japan; zdump Asia/Tokyo
Europe/Paris Tue Jan 19 10:10:57 2016 CET Japan Tue Jan 19 18:10:57 2016 JST Asia/Tokyo Tue Jan 19 18:10:57 2016 JST
If you specify a non-existing timezone, this will return the current local time :
Europe/Paris Tue Jan 19 11:11:01 2016 CET maison Tue Jan 19 10:11:01 2016 maison 127.0.0.1 Tue Jan 19 10:11:01 2016There is a 1-hour difference, don't know why
zdump -v Europe/Paris | grep 201[56]
Europe/Paris Sun Mar 29 00:59:59 2015 UTC = Sun Mar 29 01:59:59 2015 CET isdst=0 gmtoff=3600 Europe/Paris Sun Mar 29 01:00:00 2015 UTC = Sun Mar 29 03:00:00 2015 CEST isdst=1 gmtoff=7200 Europe/Paris Sun Oct 25 00:59:59 2015 UTC = Sun Oct 25 02:59:59 2015 CEST isdst=1 gmtoff=7200 Europe/Paris Sun Oct 25 01:00:00 2015 UTC = Sun Oct 25 02:00:00 2015 CET isdst=0 gmtoff=3600 Europe/Paris Sun Mar 27 00:59:59 2016 UTC = Sun Mar 27 01:59:59 2016 CET isdst=0 gmtoff=3600 Europe/Paris Sun Mar 27 01:00:00 2016 UTC = Sun Mar 27 03:00:00 2016 CEST isdst=1 gmtoff=7200 Europe/Paris Sun Oct 30 00:59:59 2016 UTC = Sun Oct 30 02:59:59 2016 CEST isdst=1 gmtoff=7200 Europe/Paris Sun Oct 30 01:00:00 2016 UTC = Sun Oct 30 02:00:00 2016 CET isdst=0 gmtoff=3600
Timestamp | Usage | Changes when ... |
---|---|---|
atime | file access time | the file is
see also : atime and mount options
|
ctime | inode change time |
|
mtime | file modification time | the file is
|
creation timetimestamp
guessedwhen ctime == mtime (but quite unreliable )
%x
' myTestFile; sleep 1; cat myTestFile 1>/dev/null; stat --format='%x
' myTestFile; rm myTestFile2021-02-04 15:20:21.868392531 +0100 2021-02-04 15:20:22.868392531 +0100
2021-02-04 15:20:36.780392531 +0100 2021-02-04 15:20:36.780392531 +0100