Add the following line to the section of the Syncovery. To begin, lets see how to list files showing their date using the ls (List) command followed by the -l flag for long. It is advisable to run the above command first, to see what files are selected. Optionally, you can specify -print at the end of the command, but that is the default action. The following bash script works perfectly fine. This will find all files older than 15 days and print their names. Finding and removing files older than 30 days Ask Question Asked 5 years, 9 months ago Modified 3 years, 10 months ago Viewed 22k times 3 I am looking to clear the users files older than 30 days. To enable these deletions to occur in unattended mode, you also need to add a switch to the INI file. 5 Answers Sorted by: 97 You could start by saying find /var/dtpdev/tmp/ -type f -mtime +15. If you have thoroughly verified that the profile works 100% correctly, and does not delete any files that you want to keep, then go to Safety->Unattended and allow 100% deletions (because 100% of the older files are deleted). The trick is to capture the output of date +s inside awk and. The grep tar in the listing command is just for my own purpose to list only tar files, can be adapted of course. Solved-How to delete files older than x seconds (not days, hours or minutes) on shell-bash. Run the job manually and look at the Sync Preview to make sure it works correctly and deletes the correct files only. 4 Answers Sorted by: 5 This question is very old but I still wanted to add my bash only solution as I was just searching for one when I came here. You need to use Advanced Mode in Syncovery to do this.Īfter setting the job up with the correct filters, you need to test it in Attended Mode. For example, you can use a File Age filter to delete files older than 14 days only. To delete files, you need to set up a job (profile) and mirror an empty folder to the destination using Exact Mirror Mode. A frequently requested functionality is to delete files from a folder which are older than X days. Using the find command, you can search for and delete all files that have been modified more than X days. You can automatically delete files based on certain criteria with Syncovery.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |