delete files older than code example
Example 1: delete old files linux
find /opt/backup -type f -mtime +30 -exec rm -f {} \;
Example 2: delete logs older than 7 days linux
find /media/bkfolder/ -mtime +7 -name'*.gz' -exec rm {} \;
Example 3: script delete files older than
forfiles /P "C:\LehrerOffice_Backup\BatchBackup\" /S /M *.* /D -31 /C "cmd /c del @PATH"