How To Find Folder or File Older Than x Days and Move Them To Other Directory or Path

0
592

– Create folder /var/www/old_www-7days/ as destination path

– Run find and move (in this case older than 7 days) to old_www-7days

Folder:

[email protected]:~# find /var/www/html/ -type d -mtime +7 -exec mv “{}” /var/www/old_www-7days/ \;

File:

[email protected]:~# find /var/www/html/ -type f -mtime +7 -exec mv "{}" /var/www/old_www-7days/ \;

LEAVE A REPLY

Please enter your comment!
Please enter your name here