Sponsored Content
Operating Systems OS X (Apple) Batch file to move video files and retain sub-directories Post 302522316 by mm0mss on Saturday 14th of May 2011 10:30:08 AM
Old 05-14-2011
Batch file to move video files and retain sub-directories

I have just purchased my first ever Apple computer - and am therefore new to UNIX also.

I would like to create a simple "batch file" (apologies if this is the wrong terminology) to do the following:

When I plug my camera into the MAC it automatically downloads photos and videos into a new sub-directory inside the "Pictures" folder, the new folder name is the date on which the photos were taken.
eg,
Pictures\2011-04-28

The problem is it puts both photos (jpg) and videos (avi) into this folder. I want to separate the photos from the videos.

I need a script which will move the videos to a new folder inside "Movies" but retains the date based sub-directory name.
eg,
Movies\2011-04-28

I hope this makes sense!

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A Batch job to delete files from various directories

Hi, I have a shell script to find files older than 'X' days ($2) in directory path ($1) and delete them. Like this: my_file_remover.sh /usr/home/c 90 Now, I need to modify this script and add it in CRON, so that it checks other directories also. Like: my_file_remover.sh /usr/home/c... (3 Replies)
Discussion started by: guruparan18
3 Replies

2. UNIX for Dummies Questions & Answers

Batch Renaming: Change files' extensions in many sub-directories

Hi all - I'm trying to rename a large number of files all at once and need some help figuring out the command line syntax to do it. I've already done quite a bit of research with the rename and mv commands, but so far haven't found a solution that seems to work for me. So: The files exist... (10 Replies)
Discussion started by: dave920
10 Replies

3. Shell Programming and Scripting

move files and retain subdir structure

hi: I have some files like this folder1/recording1.mp3 folder1/docs/budget.doc folder2/others/misc.mp3 folder3/others/notes.doc all this folders and files are under the mp3 folder. I would like to move just the mp3s to another folder but retain the subdir structure i have. So if... (4 Replies)
Discussion started by: jason7
4 Replies

4. Shell Programming and Scripting

want to move files in a dir into different directories based on the filename

I want to move the files in a dir to different dirs based on their file names. Ex: i have 4 different files with name - CTS_NONE_10476031_MRL_PFT20081215a.txt CTS_NONE_10633009_MRL_PFT20091020a.txt CTS_NONE_10345673_MRL_PFT20081215a.txt CTS_NONE_10872456_MRL_PFT20091020a.txt and the 1st... (4 Replies)
Discussion started by: Sriranga
4 Replies

5. Shell Programming and Scripting

Loop to move files in different directories

Hi, I have various log files in different paths. e.g. a/b/c/d/e/server.log a/b/c/d/f/server.log a/b/c/d/g/server.log a/b/c/h/e/server.log a/b/c/h/f/server.log a/b/c/h/g/server.log a/b/c/i/e/server.log a/b/c/i/e/server.log a/b/c/i/e/server.log and above these have an archive folder... (6 Replies)
Discussion started by: acc01
6 Replies

6. Shell Programming and Scripting

Recursively move directories along with files/specific files

I would like to transfer all files ending with .log from /tmp and to /tmp/archive (using find ) The directory structure looks like :- /tmp a.log b.log c.log /abcd d.log e.log When I tried the following command , it movies all the log files... (8 Replies)
Discussion started by: frintocf
8 Replies

7. Shell Programming and Scripting

Batch cycle and move files, please help

Hi guys, I'm not a great programmer but I do this project with a cool data and it has tons and tons of files which I need to sort before I can work with it. The problem I need to solve is to move all files that look like /X/Y/A_BC.xml to /X/B/A/Y/BC.xml So it involves cycling through... (7 Replies)
Discussion started by: drunkoctopus
7 Replies

8. UNIX for Dummies Questions & Answers

Move multipe files to corresponding directories

Hi, In a parent directory there are several files in the form IDENTIFIER1x IDENTIFIER1.yyy IDENTIFIER1_Z, etc IDENTIFIER2x IDENTIFIER2.yyy IDENTIFIER2_Z, etc IDENTIFIER3x IDENTIFIER3.yyy, IDENTIFIER3_Z, etcIn the same parent directory there are corresponding directories named... (7 Replies)
Discussion started by: spirospap
7 Replies

9. Shell Programming and Scripting

Need BASH Script Help to Move Files While Creating Directories

I've got this script to loop through all folders and move files that are more than 2 years old. I'm using the install command because it creates the necessary directories on the destination path and then I remove the source. I'd like to change the script to use the mv command since it is much... (4 Replies)
Discussion started by: consultant
4 Replies

10. UNIX for Beginners Questions & Answers

Move several files into specific directories with a loop

Hello, I'm a first time poster looking for help in scripting a task in my daily routine. I am new in unix but i am attracted to its use as a mac user. Bear with me... I have several files (20) that I manually drag via the mouse into several named directories over a network. I've used rsync... (14 Replies)
Discussion started by: SonnyClark
14 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 11:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy