Skip to content

Instantly share code, notes, and snippets.

@giri-v
Created June 3, 2020 21:01
Show Gist options
  • Save giri-v/4926505a69a22d01e074bea8d262ca4e to your computer and use it in GitHub Desktop.
Save giri-v/4926505a69a22d01e074bea8d262ca4e to your computer and use it in GitHub Desktop.
Automated "delete files older than" bash script
#!/bin/sh
echo "Starting cleaning old files..."
find [Path to search] -mtime +10 -type f -delete
echo "Finished cleaning old files..."
(sleep 1d;/bin/sh [Path to this file]/cleanoldfilesdaily.sh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment