so I reviewed every script here regarding deleting directories older than 14 days. script I wrote work with files, but for some reason it does not delete directories. So here are my scripts.
Thus, this code successfully deleted FILES inside TBD, but it left two directories. I checked the timestamp on them and they are at least 2 days after the last modification according to the timestamp. In particular, December 16, 16:10 So I can not understand this. My crontab, which I run, starts every minute, and it only shows the logs and logs.
+ /scripts/deletebackups.sh: :2:BASH_XTRACEFD=3xargs rm -rf + /scripts/deletebackups.sh: :2: BASH_XTRACEFD=3find /TBD/contents TBD/contents -mtime +1
I used the content, because in fact this name is actually on our pxe server. I checked every file and INSIDE folder in these two directories, and their timestamps match the parent directory as they should be, but they still are not deleted.
Could this be a fix? I wrote a script using sudo nano deletebackups.sh When I type ls under TBD in the far left, it shows drwxr-xr-x 3 hscadministrator root 4096 DEC 16 16:10 for each of the two directories that will not be deleted. I am not very familiar with what all these letters mean.
Other iterations of this code that I have already done are
find /TBD/* -mtime +1 rm -r {} \;
source share