Skip to content

Instantly share code, notes, and snippets.

@onfire4g05
Created March 7, 2014 20:15
Show Gist options
  • Save onfire4g05/a23b20fcaa04d62f305b to your computer and use it in GitHub Desktop.
Save onfire4g05/a23b20fcaa04d62f305b to your computer and use it in GitHub Desktop.
Will move files based on time specified, keeping directory structure
find . -mtime +1786 -type f -print0 | xargs -0 -I {} sh -c '
file="{}"
destination="/var/shares/primary/backup-images"
mkdir -p "$destination/${file%/*}"
mv "$file" "$destination/$file"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment