linux - Remove log files using cron job - Stack Overflow?

linux - Remove log files using cron job - Stack Overflow?

WebJun 16, 2024 · Now using the previous command we will create a script called delete_old_files.sh, this file will take care of removing the files that are located at /test/my_folder and are older than 7 days. #!bin/sh find /test/my_folder -type f -mtime +7 -exec rm {} + Add the Cron job. Run the following command to open crontab: crontab -e WebSep 18, 2024 · In this article I will show example of cron job for Linux to delete files older than 10 days. How to Edit Crontab file. To edit or create new crontab file, type the following command: $ crontab -e Cron Job To … aquariums near norfolk va WebMar 17, 2014 · You should use crontab -e to edit your crontab and schedule the job. It might look something like this: * 1 * * * /usr/bin/find /path/to/file -name '*.log' -mtime +7 -exec rm -f {} \; This will recursively remove all .log files in the directory /path/to/file every day at 1am. Share Improve this answer Follow answered Mar 17, 2014 at 18:48 WebApr 20, 2007 · Deleting files older than 7 days. Hi Guys, I want to delete folder/files older than 7 days. Im using the command below. find /test/test1 -mtime +7 -print0 xargs -0 rm -Rf /test/test1/* which works ok, but it deletes the test1 folder as well which i dont want. The test1 folder will have a list of sub-folders which in... a coffin WebJul 24, 2024 · Cron Jobs: Move files to other folder rsgertos Jul 23, 2024 R rsgertos Cadet Joined May 6, 2024 Messages 5 Jul 23, 2024 #1 Hi Guys, I would like to ask if my command is right for moving files to other folders I have to 2 path: /mnt/BountyDumping/BountyDumping/ /mnt/BountyDumping/Recycle Bin/ my command is: WebWithout much delay, let me show you the steps to use task scheduler to delete files older than a number of days in Windows 10. Use task scheduler to delete files older than X … ac off rest mercedes ne demek WebDec 21, 2024 · I also want to delete backup files older then 1 day. I am using below command to delete the old files, but it only works through terminal. If I set cronjob for same command then it does not work. I don't …

Post Opinion