How would i go about that? Feel free to modify my question if it's not clear. It did actually work on a test directory i created (test1 obviously) with a bunch of test files that were all younger than one day, i don't think that the 'older than' argument is even in here. Paste the below command in the Add arguments field. Type powershell in the Program/Script field. I've stumbled over this command that i could use with crontab: perl -e 'for()'īut i don't really understand this command, as i understood it's some kind of loop. Use task scheduler to delete files older than X days Open task scheduler. I can see the job is running, but the files still exist in the folder. Consider a script that deletes files older than 10 days in a directory (it can be used when you need to clean up the logs folder, or public network folders). Delete files older than xx days using PowerShell. txt files in a folder that are older than 7 days. log extension and indicated that they could be deleted by this script. Gives an error ' argument list too long' since there are that many files (they're not even that big, it's just a lot of pictures and small videos from a security camera working with motion software - which is great by the way ) I have a cron job that runs at midnight to delete all. Search for jobs related to Batch script to delete files older than 30 days or hire on the worlds largest freelancing marketplace with 21m+ jobs. As mentioned in title, i'm trying to delete files that are older than one day inside a directory with many many files (without actually deleting the said directory) - the directory is backed up by a remote rsnapshot server so i don't need the source files anymore as soon as they're backed up, the problem is that find /directory/* -mtime +1 -delete
0 Comments
Leave a Reply. |