InMotion Hosting Support Center

Run a cron job only of the output of the previous job is removed

Category: Cpanel

n/a Points
2016-03-07 5:37 pm EST

Hits: 29
How do i set a cron job to post a file only when the previous file has been changed/renamed to avoid the file being over written?

You must login before you can ask a follow up question.

You must login before you can submit an answer.



43,761 Points
2016-03-07 5:49 pm EST

Thank you for your question on running a conditional cron job. A cron job is only a timed script. The fact that it is a cron has no bearing on the script itself. This means that the script will need to be written to check for the previous file and if it is still there, it will not run.

Technically the cron will still run, but the script will decide whether or not to create a new file or not.

Kindest Regards,
Scott M

You must login before you can post a comment about this answer.

Like this Question?

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Need more Help?

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!