Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Stopping or changing batch script execution if no files created yesterday?

$
0
0

I'm looking for ideas on how to change the execution of my script if no files were written *yesterday*.

I have a 3rd party system that's directing its backups to an FTP folder on our Windows system.  To manage space, I have a cmd batch script that's scheduled to run daily that purges files from the FTP folder using the forfiles command with the "/D -10" parameter.  However, if the backup process on the 3rd party system should fail repeatedly, then the purge would continue to run until all backups are purged.

Forfiles doesn't work for finding files written yesterday ONLY because it returns all files equal to OR LESS THAN the number of days specified.

"If exist" doesn't work either because there will always be 9 - 10 previous backup files in the folder.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>