I'm currently working on a script that allows me to move any file thats older than 5 days into an archive folder with the same path, except for the root folder which changes.
So something like:
root/subdir1/subdir2/file
to rootarchive/subdir1/subdir2/file
.
It should work recursivly.
I've already tried creating a foreach for all the files of the "root" folder:
#!/bin/bash
find . -type f -name '*.*' -print0 | while IFS= read -r -d '' file; do
mv $file ../rootarchive/"$file"
done
But this didn't work properly as I the mv command couldnt find the specified destination ../rootarchive/"$file"
.
Has anyone of you an idea how I could solve this problem?
debugfs
.