Hi guys just wondering if there is a way to
scan the whoel file system and find files that have not been used over a number of days, using the script
i don't think we have to do it by the script
find $path -mtime +2 -a -type f
$path=the directory which u want to scan
+2=u haven't use the file for 2 days
u can use "man find" for the details as well
To add to the above if i used a command like
mv "whatever the find command fines" /temp/oldfiles
how i would i actually tell the move command to get whatever the find command finds then move it to the /temp/oldfiles
because if i go like this mv /temp/oldfiles beneath the find command i get missing destination file operand after /temp/oldfiles
In short i want to find all old files that have not been used for a few days then move them to another directory where they get archived
find $path -mtime +2 -a -type f exec mv /temp/oldfiles
find "$path" -type f -mtime +2 -exec mv {} "$whereto" ";"
works for me
Should be:
find $path -mtime +2 -type f -exec mv {} /temp/oldfiles \;
Regards