Created
March 4, 2014 06:28
-
-
Save xupyprmv/9341324 to your computer and use it in GitHub Desktop.
Remove all files in specified folder older than N minutes (N is a parameter (bash, checked on Ubuntu 12.04)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 2 ]; then | |
find $2 -type f -mmin +$1 -delete | |
else | |
echo "Illegal arguments. Right syntax is: removeold.sh N FOLDERPATH" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment