I have a script that runs every day. Depending on what day of the week it is, or if tomorrow is the last day of the month, it will move files into different locations. I have omitted the actual functions.
TOM=$(TZ=UTC-24 date +%d) SUNDAY=$(date +%w)
The logic is as below:
if [ $TOM -eq 1 ]; then move_files monthly echo EXEUTING END OF MONTH MOVE AND PURGE, NON-DAILY, NON-END-OF-MONTH elif [ $SUNDAY -eq 0 ]; then move_files weekly echo EXECUTING SUNDAY MOVE AND PURGE, NON-DAILY, NON-END-OF-MONTH else echo EXECUTING DAILY MOVE AND PURGE NON-SUNDAY, NON-END-OF-MONTH move_files daily fi
Everything executes properly, however yesterday (Nov. 30th) it did not properly move the files into the
monthly directory, which is part of the
move_files monthly function. Testing elsewhere, this seems to work fine.
The host I'm running this on is on UTC.