i do not know if this cron is true or not. I want to make backup database every two months, respectively [on hold]


i do not know if this cron is true or not. I want to make backup database every two months, respectively [on hold]



This question appears to be off-topic. The users who voted to close gave this specific reason:





Well, have you tried the cron? Why is it not working for you ?
– Dvorog
Jul 1 at 10:20



cron





Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Unix & Linux Stack Exchange would be a better place to ask.
– jww
Jul 1 at 13:36




1 Answer
1



You are currently running your command on the 28th through the 31 in every second month. You likely want to define just one day you run it at, assuming you actually want to run your backup just once every 2 months.



This would do the trick running at the first of each second month: 0 0 1 */2 * test $(date -d tomorrow +%d) -eq 1 && php /path-to-your-project/artisan backup:run >> /dev/null 2>&1


0 0 1 */2 * test $(date -d tomorrow +%d) -eq 1 && php /path-to-your-project/artisan backup:run >> /dev/null 2>&1

Popular posts from this blog

How to add background colour in existing image using Swift?

Moria Casán

How to make file upload 'Required' in Contact Form 7?