DEV Community

Discussion on: Good Programmer vs Average Programmer - and, Why Asking questions and Paying attention to Details matters.

Collapse
 
alexandis profile image
alexandis • Edited

"He did not think about two contradicting parts in this script, finding files older than 30 days and running it on the 1st of every month. Since the script's objective here is to back up last month's data and month can be any of 28, 29, 30, or 31 days. So if you run this script on 1st march, it will not archive any files because all of them are less than 30 days old because February is usually 28 days long."

  • sorry, did not get this. First of all - the question does not mention that "objective here is to back up LAST month's data". It only says "files older than 30 days". How I would understand the task - if I am running the script on the 1st of March - I would archive all the files that are older than 30th of January. So it WILL archive some files if such are present in the system. Of course, archiving the files for a part of month looks a bit weird. So i would reask - is it really how you want it to work?