Fix for crontab.

Fix for argument at timelapse_monthly.sh.
master
Holger Wirtz 5 years ago
parent 0ece6b3294
commit 647cd408b6
  1. 6
      README.md
  2. 2
      bin/timelapse_monthly.sh

@ -6,8 +6,8 @@ Crontab:
#
*/5 * * * * ssh timelapse@192.168.111.2 "sudo date -s\"`date`\"" >/dev/null 2>&1
0 * * * * ${HOME}/timelapse/bin/timelapse_gatherer.sh
0 2 * * * rm /mnt/extern/timelapse/daily/*; ${HOME}/timelapse/bin/timelapse_daily.sh && ${HOME}/timelapse/bin/timelapse_video.sh daily
0 3 * * 1 rm /mnt/extern/timelapse/weekly/*; ${HOME}/timelapse/bin/timelapse_weekly.sh && ${HOME}/timelapse/bin/timelapse_video.sh weekly
0 3 1 * * rm /mnt/extern/timelapse/monthly/*; ${HOME}/timelapse/bin/timelapse_monthly.sh && ${HOME}/timelapse/bin/timelapse_video.sh monthly; rm /mnt/extern/timelapse/yearly/*; ${HOME}/timelapse/bin/timelapse_yearly.sh && ${HOME}/timelapse/bin/timelapse_video.sh yearly
0 2 * * * rm -rf /mnt/extern/timelapse/daily/*; ${HOME}/timelapse/bin/timelapse_daily.sh && ${HOME}/timelapse/bin/timelapse_video.sh daily
0 3 * * 1 rm -rf /mnt/extern/timelapse/weekly/*; ${HOME}/timelapse/bin/timelapse_weekly.sh && ${HOME}/timelapse/bin/timelapse_video.sh weekly
0 3 1 * * rm -rf /mnt/extern/timelapse/monthly/*; ${HOME}/timelapse/bin/timelapse_monthly.sh && ${HOME}/timelapse/bin/timelapse_video.sh monthly; rm -rf /mnt/extern/timelapse/yearly/*; ${HOME}/timelapse/bin/timelapse_yearly.sh && ${HOME}/timelapse/bin/timelapse_video.sh yearly
0 9 * * 1 [[ "$(/bin/date +\%d)" -le 7 ]] && ${HOME}/timelapse/bin/timelapse_garbage_collector.sh # runs only the first monday a month
```

@ -9,7 +9,7 @@ CLIENT_FOLDER="/timelapse"
if [[ "${1}" =~ [0-9]+ ]]
then
MONTH=${1}
if [ ${MONTH} -lt 10 ]
if [ `expr length ${MONTH}` -lt 2 ]
then
MONTH="0${MONTH}"
fi

Loading…
Cancel
Save