Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help moving data.

Status
Not open for further replies.

bdina

Programmer
Jun 17, 2003
47
US
I have a file that is inside every user home directory on my system that I need to have moved every month, and can not figure out how to do so. Currently I am trying to use "find" to do so, here is what I am trying that does not work:

find /home/ -type f -exec mv badmail badmail.old \;

that does not work, but it was my original idea that I would put that command into a cron job, and it would run every month to rotate the file(s).

Any ideas??

--Bryan
 
Personally I'd script it,

#!/path/to/shell

find /home -name badmail | while read file
do
mv $file $file.old
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top