"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?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
"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."