LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mv: missing file argument (https://www.linuxquestions.org/questions/linux-newbie-8/mv-missing-file-argument-786330/)

ericczed 02-01-2010 09:55 PM

mv: missing file argument
 
Hi, I`m totally new to Linux and I would really appreciate any help I can get. Here`s my scnenario below:

Objective: To move or backup all the 30 days old files to the other server within LAN.

I have tried testing it first within the server by performing below commands:

find /usr/test1/* -mtime +30 -exec mv {} /usr/test2/ \;

But I`m getting "mv: missing file argument" error when I try this.

Please Help.

Thanks in advance,

ericczed

catkin 02-01-2010 10:22 PM

You can see what commands find is generating by inserting an echo after -exec
Code:

find /usr/test1/* -mtime +30 -exec echo mv {} /usr/test2/ \;
Presuming you only want to move ordinary files you need -type f
Code:

find /usr/test1/* -type f -mtime +30 -exec mv {} /usr/test2/ \;


All times are GMT -5. The time now is 04:37 PM.