LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 12-12-2012, 02:11 AM   #1
sharp859
LQ Newbie
 
Registered: May 2008
Posts: 28

Rep: Reputation: 0
script to detect new directory and move contents


Hello,

Anybody could help my scenario with shell script, I am very new to this.

1. Everyday there will be a directory is getting updated with some contents in a server, I should be able to find the latest directory in that based on particular string and copy to another directory with date. Any idea. using shell script.

directory structure will be `date`/mystring-.xxx/

Every day the date directory will be updated to that days date. Parameterized would be great.
 
Old 12-12-2012, 03:16 AM   #2
mandyapenguin
Member
 
Registered: Nov 2011
Location: India
Distribution: RedHat, Cent OS, Fedora, Debian, Ubuntu
Posts: 106

Rep: Reputation: Disabled
You can use rsync if you are thinking for backup.
rsync finds files that need to be transferred using a "quick check" algorithm(by default) that looks for files that have changed in size or in last-modified time, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. rsync is widely used for backups and mirroring and as an improved copy command for everyday use.
 
  


Reply

Tags
script, shell script


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
[SOLVED] move directory and contents porphyry5 Linux - General 5 12-04-2011 02:22 PM
move partition with directory & contents to another drive. EDDY1 Linux - Newbie 6 08-29-2011 03:40 AM
Using mv to move the contents of one directory into another apachedude Linux - Software 13 01-16-2009 09:57 AM
need help with a ruby script listing directory contents Joseph Schiller Programming 4 01-01-2007 12:46 AM


All times are GMT -5. The time now is 09:19 PM.

Main Menu
Advertisement
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