What's new

Schedule a task each last day of month

Brouno

Occasional Visitor
It's a bit tricky, but you can do it

Use the following in /jffs/scripts/init-start script :

Code:
cru a THEIDYOUWANT "59 23 28-31 * * [[ \`date +\%d\` -gt \`date +\%d -D \%s -d \$(( \$(date +\%s) + 86400))\` ]] && THECOMMANDYOUWANT"

Replace :
THEIDYOUWANT, by a unique ID along your cru commands

THECOMMANDYOUWANT, by the command you want to execute each last day of month (usually a shell script)

Do not forget antislashs ( \ ) in script. Test without them directly on command line

It will execute "THECOMMANDYOUWANT" each last day of the month.
THECOMMANDYOUWANT is triggered at 23:59 when the value of the next day is lower than the current day, tested between 28 & 31 (for handling february)
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top