Sponsored Content
Top Forums Shell Programming and Scripting Making a script to copy files not seen before (using md5sum) Post 302848621 by nbsparks on Thursday 29th of August 2013 03:57:54 PM
Old 08-29-2013
[Solved] Making a script to copy files not seen before (using md5sum)

Hello,

I would like to make a script that searches through a SRC folder and copies only files it's never seen before to a DEST folder.

SRC = /user/.phonesync/photos-backup
DST = /usr/.phonesync/photos-new

So basically, I'd start with a:

Code:
md5sum /user/.phonesync/photos-backup/* > /user/.phonesync/photos-backup.md5

Then, I'd like to run some sort of "cp" or "rsync" from SRC to DEST after comparing the current contents of /photos-backup/ to the .md5 list. If a file is not in the MD5 list, then copy it to /photos-new/ and then add it to the photos-backup.md5. The md5 list will always get appended to and grow and grow, but I'll deal with that at some point by deleting it and generating a new md5 list.

Last edited by nbsparks; 08-29-2013 at 05:09 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

making copy of 0 level dump via ufsdump

Hi how do u make "copy" of o level dump taken via ufsdumo in solaris? To elaborate, imagine you have taken a 0 level dump via the following command ufsdump 0ulf /dev/rmt/1n / and then again execute the same command to take a second 0 level dump Now take an incremental dump ufsdump 1ulf... (2 Replies)
Discussion started by: vishalsngh
2 Replies

2. Shell Programming and Scripting

Running md5sum on a list of files

Hello, I would like to run md5sum on a list of files saved in a text file, and save the result in another file. (ie. md5sum `cat list.txt` > md5list.txt) I have tried several things, but I am always confronted to the same problem: some of the filenames have spaces. I have run sed on the... (5 Replies)
Discussion started by: SDelroen
5 Replies

3. UNIX for Dummies Questions & Answers

Making a copy of an Magneto Optical Disk

We are trying to make duplicates of some Magneto Optical Disks that were created in Irix 6.5. The disks are 2.3 gig and the using a scsi MOD drive. Is there possbily a disk copy like in dos or some simple script to do this - any help appreciated. Thanks (0 Replies)
Discussion started by: drew_holm
0 Replies

4. Shell Programming and Scripting

Making script show command (e.g. copy) being executed and variable substitution?

When script is running you only see when some of the commands are not successfull. Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
Discussion started by: gr0124
3 Replies

5. Shell Programming and Scripting

Script to check MD5SUM on file

Hi, I currently have a shell script that takes an RPM and scp's it to a set of remote servers and installs it. What I would like to be able to do is make the script get the md5sum of the RPM locally (so get the md5sum of the rpm from where im running the script) and then scp the rpm to the... (0 Replies)
Discussion started by: tb1986
0 Replies

6. Shell Programming and Scripting

PHP Script Help - Making links to files Clickable

Ok so I wrote a php script that outputs the below to users on a webpage. # Download: /home/content/d/i/v/divine1234/eBookDownloads/ScalpRemedy_jablaa12734.zip the php code that outputs the above is: echo ("<li>Download: $download_link</li>\n"); The thing is, I dont want... (1 Reply)
Discussion started by: SkySmart
1 Replies

7. Shell Programming and Scripting

Md5sum script

Hello, I need to download multiple files from an FTP server but occasionally they arrive in error so I need to perform an integrity check. I've been attempting to write a bash script that does the following: Downloads all files including those in sub directories Perform md5sum using... (4 Replies)
Discussion started by: shadyuk
4 Replies

8. Shell Programming and Scripting

Compare files in directories with md5sum

And not to start. I can compare files, that's easy. The problem is that I compare files in a directory, and check if these files exist in another directory. The problem is that the file names are not the same. So I have to compare with "md5sum" or something similar. How I can do? All this in... (7 Replies)
Discussion started by: Jomeaide
7 Replies

9. Shell Programming and Scripting

Need script for making files based on some conditions.

Hi All, I have a text file (code_data.txt) with the followig data. AMAR AB123456 XYZ KIRAN CB789 ABC RAJ CS78890 XYZ KAMESH A33535335 ABC KUMAR MD678894 MAT RITESH SR3535355... (26 Replies)
Discussion started by: ROCK_PLSQL
26 Replies

10. Shell Programming and Scripting

[md5sum] script

I am getting No such file or directory if my variable contains white spaces... Is there a way to fix this? This works x="1.md5" md5sum -c "$x" This, does not x="23\ 5\ 6\ 7\ 8\ 9\ 10.md5" md5sum -c "$x" md5sum: '23\ 5\ 6\ 7\ 8\ 9\ 10.md5': No such file or directory How do I fix... (1 Reply)
Discussion started by: soichiro
1 Replies
GTKAM(1)																  GTKAM(1)

NAME
gtkam - Graphical front end for gphoto2 COMMANDS
File Menu File->Save Photos Gives options to save photos to the computer. File->Save Photos->Selected Saves the selected photos from the camera to the computer. File->Save Photos->All Saves all photos in the camera to the computer. Both menu items open a "Save photos..." dialog box which allows the user to select the folder to save the images in, as well as a number of other options. What to save: This is a set of checkboxes which allows the user to select the forms in which data for the selected image(s) will be saved. Any or all of these options may be selected at once. Save photos This is the default. It causes the photos being saved to be downloaded from the camera and saved to the identified folder. Save raw data FIXME: What to say? Save audio data Causes any audio data associated with the image to be saved to the selected folder. Save thumbnails Saves a small version of the selected images to the identified folder. Save EXIF data Saves the EXIF data associated with the images. FIXME: should we say more about the EXIF format? Open image(s) with: This allows the user to specify FIXME ?? Use filename(s) provided by the camera. Causes the saved files to have the names provided by the camera. Filename prefix: Defines a prefix to be used when creating filenames. This prefix is combined with the number starting with the number defined in: Start numbering with: Defines the first number of the sequence of photos to be stored. File->Delete Photos Gives options to delete photos from the camera. File->Delete Photos->Selected Deletes selected photos from the camera. File->Delete Photos->All Deletes all photos in the camera. Both of these menu items open a dialog to confirm the deletion of the photos. A list of photos is presented with a checkbox beside each photo name. Uncheck the box to prevent a specific file from being deleted. File->Quit Quits gtkam. View Menu Gives options for previewing photos before downloading them from the camera. View->View Thumbnails This is the same command as the checkbox on the main gtkam window. It allows the user to select whether thumbnails of the photos are displayed, or just the file names. View->Zoom In Enlarges the thumbnails. View->Zoom 100 Returns the thumbnails to default size. View->Zoom Out Reduces the thumbnails. Select Menu Select->All Selects all pictures in the camera. Select->Inverse Inverts the selections already made so that previously unselected images are now selected, and previously selected images are now unselected. Select->None Undoes all selections so that no images are selected. Camera Menu Camera->Add Camera... Opens a window to allow the user to define the camera and interface being used. "Simple" Select Camera Dialog. "Enhanced" Select Camera Dialog. Dialog for explicitly adding a path to the port to which the camera is attached. Help Menu Help->Debug... Opens the logging window which allows the user to select the type of messages to log. Error causes the logging of any error messages. Verbose Increases the amount of information being logged. (I can't see what effect this has. - mjr) Debug Causes the logging of progress reports as the software communicates with the camers. Data Causes the logging of all data being transferred from the camera. This will generate huge quantities of hexadecimal informa- tion. Save As... opens a dialog to allow the user to save the information logged in the debug window. Close Closes the debug window Help->About... Opens the about gtKam window. This gives the current version, author credits, and contact information. Right Click (over directory pane) Menu Right Click->Upload File Opens a dialog to identify an image file for uploading to the camera. Right Click->Make directory Opens dialog to create new directory. Right Click->Remove directory Opens a dialog to remove (delete) an existing folder (directory). Right Click->Capture Opens a window to allow the user to trigger the camera to acquire an image if the camera and its gphoto2 driver supports this fea- ture.. (This feature is not available on my camera, so I would appreciate some input on this item. -mjr) Right Click->Preferences Camera configuration tab. Driver configuration tab. Right Click->Summary Displays a window with information about the camera and its memory. Right Click->Manual I'm not sure what this should contain. Anyone? - mjr FIXME: need useful image Right Click->About Displays a window with information about the camera driver and its authors. This should include contact information for the maintainers of the drivers for your camera. Right Click->Select Camera Opens the Add Camera dialog. Right Click->Remove Camera Removes the camera from the directory pane. Right Click (over list pane) Menu Right Click->View with...->Built-in viewer Downloads the image under the cursor and displays it in a new window. The window automatically resizes the image to fill the window. Right Click->Info Presents file name, type, size, date and permissions information about the image under the cursor. Right Click->Save Downloads the image under the cursor and opens a dialog to allow it to be saved to the computer. Right Click->Delete Opens a dialog to allow the user to delete the image under the cursor. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-------------------------------+-----------------------------+ |ATTRIBUTE TYPE^ATTRIBUTE VALUE | | +-------------------------------+-----------------------------+ |Availability^SUNWgnome-camera | | +-------------------------------+-----------------------------+ |Interface stability^Volatile | | | | | +-------------------------------+-----------------------------+ AUTHOR
The gPhoto2 Team. Man page edited by Michael J. Rensing <michael.rensing@shaw.ca>. August 2002 GTKAM(1)
All times are GMT -4. The time now is 09:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy