Help with Find All/Copy Script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with Find All/Copy Script
# 1  
Old 08-30-2008
Help with Find All/Copy Script

Hi Gang, I am an old unix user and just recently returned in the flavor of a Mac. I have tons of pictures in the .orf format and would like to write a script to:

Search the Hard drives for that file type
Then, depending on date, copy it to a specific folder
If there is an exact copy, only keep one

How hard is this to do? Many thanks. I am very happy to be away from MS again!
# 2  
Old 08-31-2008
this script should find files in tree structure $whereToFind that are less than 5 days old + copy them to $path_to_specific_folder

$path_to_specific_folder="$HOME/myPhotos";
$whereToFind="/"
find $whereToFind -type f -name "*.orf" -mtime -5 -exec cp {} $path_to_specific_folder ";"
# 3  
Old 08-31-2008
For avoiding duplicates, you might want to pull just the file names into a list, and generate MD5 sums of all the files in that list. If two files have the same MD5, they are identical (with a probability which is close enough to certainty for most practical purposes). Remove duplicate MD5s, then copy the remaining files. (If the file format makes it unlikely that two different files will have exactly the same size, that might be good enough, and a lot quicker than MD5 to calculate.)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ls to find to copy

I am looking to do the following: In a folder with multiple files in it, take the listing (ls) and search another directory for there file names, then take that output and copy the files out. This is to update a webpage. So a dev writes a new file and puts it in an update folder then i copy... (7 Replies)
Discussion started by: darbs121
7 Replies

2. UNIX for Dummies Questions & Answers

Help with find and copy

Hi , As i am a dummy in shell scripting ,i was trying to find the files which are created today and hold them in variable and the copy them to a location using a partcular command this is what did. can any one help.There may be many files under the path SOURCE=/path/to/files/ A= find... (1 Reply)
Discussion started by: vikatakavi
1 Replies

3. Shell Programming and Scripting

Writte a script to copy the files older than 7 days using find and cp

Hi I'm trying to writte a script (crontab) to copy files from one location to another... this is what i have: find . -name "VPN_CALLRECORD_20130422*" | xargs cp "{}" /home/sysadm/patrick_temp/ but that is not working this is the ouput: cp: Target... (5 Replies)
Discussion started by: patricio181
5 Replies

4. Shell Programming and Scripting

find and copy script trouble

Hi guys First thing to say is that I am entirely new to Shell Scripting and am trying to write a script to do something I thought would be relatively simple, but has escaped me. Essentially, I want to take file name information from a list, find the files listed and then copy the results into... (0 Replies)
Discussion started by: acheron
0 Replies

5. Shell Programming and Scripting

Find and copy

> Advice please as much as possible to fill in large file in various folder to the server > Folder structure /www/1.org/htdocs /www/2.org/htdocs /www/3.org/htdocs > Can tell me there is a way to fill in large file into htdocs, and then climb > In each Diru and load for a long time. Thank you (1 Reply)
Discussion started by: lol100
1 Replies

6. Shell Programming and Scripting

Perl Script to find & copy words from Web.

I need to write a perl script to search for a specific set of numbers that occur after a series of words but before another. Specifically, I need to locate the phrase today at the summit, then immediately prior to the words tonnes/day copy the number that will be between 100 and 9,999, for example,... (1 Reply)
Discussion started by: libertyforall
1 Replies

7. Shell Programming and Scripting

Shell Script, Copy process using find.

Ok, so here is what I am looking for.. Shell script that uses find to look for one days worth of data using the modified date and then copies only those files to a specified directory. I figured I could use grep and the find command to do this. It seems to work just fine from what I can... (4 Replies)
Discussion started by: techjunky
4 Replies

8. Shell Programming and Scripting

How to find files and then copy them to another

I must write any shell script. I want find files which have .txt extension and then copy them to other, whithout this extension, for example: I found linux.out.txt file, and now it must be copy to new, linux.out. So: linux.out.txt -> linux.out ubuntu.config.txt -> ubuntu.config ... (4 Replies)
Discussion started by: piespluto
4 Replies

9. Shell Programming and Scripting

shell script to find and copy the files creted in the year 2006 to another directory

Hi All, I am new to UNIX. I will be thankful if some one helps me. I have to write a shell script for one of the requirement. I have files created from Jan 2006 to March 2008. My requirement is to write a script in such a way that 1) To find and copy(not Moving) the files created in the... (2 Replies)
Discussion started by: manas6
2 Replies

10. UNIX for Dummies Questions & Answers

HOw to find and copy

Hi, I need to find files in a directory, between dates like 4/15/06 and 5/02/06, and copy them to a different directory. Is there a way to doa find and a copy together? Thanks, Neil (1 Reply)
Discussion started by: aaajohnson
1 Replies
Login or Register to Ask a Question