Linux deletes files 30 days ago under a folder
Delete files periodically through the cron job of Linux
# change to the corresponding directory # cd / etc/cron.daily # create a new executable file clear#vi logcron# enter the following content #! / bin/sh # here implement the command find / logs-type f-ctime + 30 | xargs rm-rf # then save the file, and finally execute the following command to give the file service executable permission # chmod + x / etc/cron.daily/logcron