-   Linux - Newbie (
-   -   script to detect new directory and move contents (

sharp859 12-12-2012 01:11 AM

script to detect new directory and move contents

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`/

Every day the date directory will be updated to that days date. Parameterized would be great.

mandyapenguin 12-12-2012 02:16 AM

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.

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