Reputation:
In case of cron job that creates an archive with a constant name will the archive be replaced with new one on the next cron job or terminated as the file with this name is already exists?
Upvotes: 1
Views: 2208
Reputation: 17071
Cron just run your command, so it's up to you how this command may look. For example:
0 8 * * * rm -rf arc.zip && zip -r arc.zip /tmp
This cron runs every day at 8am and performs next steps:
arc.zip
arc.zip
from /tmp
directoryUpvotes: 1
Reputation: 311498
There's no magic in cron
- it just runs a program at a given timing. If that program has the logic to check if the archive exists, it will still have it when run via as a cron job. If it just overwrites the archive, it will continue doing so when run as a cron jbo.
Upvotes: 2