Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-01-2010, 09:55 PM   #1
LQ Newbie
Registered: Jan 2010
Posts: 2

Rep: Reputation: 0
Smile 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,

Old 02-01-2010, 10:22 PM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian except for netbook still on Slackware 13.37 (and I have to support Ubuntu)
Posts: 8,572
Blog Entries: 30

Rep: Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182Reputation: 1182
You can see what commands find is generating by inserting an echo after -exec
find /usr/test1/* -mtime +30 -exec echo mv {} /usr/test2/ \;
Presuming you only want to move ordinary files you need -type f
find /usr/test1/* -type f -mtime +30 -exec mv {} /usr/test2/ \;


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
find: missing argument to `-exec' mkyp Linux - General 4 10-09-2009 11:13 AM
find: missing argument to `-exec' pavodive Linux - Newbie 4 10-05-2009 02:24 PM
Write a function that takes an input argument a file and returns the date to stdout 1subject Programming 1 06-17-2009 11:17 AM
[SOLVED] pass file-name as command line argument vikas027 Programming 2 10-14-2008 11:52 PM
message sending failed : Error[22 ] invalid argument .....but each and every argument rakeshranjanjha Linux - Software 2 01-07-2008 11:22 PM

All times are GMT -5. The time now is 03:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration