Download your favorite Linux distribution at LQ ISO.
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, 10: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, 11:22 PM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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 12:13 PM
find: missing argument to `-exec' pavodive Linux - Newbie 4 10-05-2009 03:24 PM
Write a function that takes an input argument a file and returns the date to stdout 1subject Programming 1 06-17-2009 12:17 PM
[SOLVED] pass file-name as command line argument vikas027 Programming 2 10-15-2008 12:52 AM
message sending failed : Error[22 ] invalid argument .....but each and every argument rakeshranjanjha Linux - Software 2 01-08-2008 12:22 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 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
Open Source Consulting | Domain Registration