LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 02-01-2010, 09:55 PM   #1
ericczed
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,

ericczed
 
Old 02-01-2010, 10:22 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,528
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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/ \;
 
  


Reply


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 02:51 PM.

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