On 17Dec2010 22:41, chipandfamily <[email protected]> wrote: | I'm not sure how to write scripts for my computer. I've read the help | books, and I must admit that I'm no programmer and it makes no sense. | | What I'm trying to do is this: | | I just bought my wife an LCD picture frame. Each time we have new | files, I want to have a script that will search the directory where | all my photographs are at, and then copy it over to the SD card all the | while ignoring the new photos. | Also, i would want the script to move | the photos from its subdirectories and move them to the Photos main | directory and erase the subdirectories. | | I have no idea where to begin on something like this, so any help | would definitely be appreciated.
Break it into smaller tasks, until each is doable. The rsync command is very useful for copying and moving files. It has many options, and so will take some time to become familiar with. Its core usage is like the "cp" command: rsync stuff... destination which copies the stuff into the destination. | I just bought my wife an LCD picture frame. Each time we have new | files, I want to have a script that will search the directory where | all my photographs are at, and then copy it over to the SD card | all the while ignoring the new photos. Ok. Let us suppose your photos are in ~/photos and the SD card is mounted as /mnt/sdcard. These paths are entirely made up and will depend on your setup. Assuming them, though: rsync -av --ignore-existing ~/photos/ /mnt/sdcard/ should do a rough approximation of what you ask. test it like this: rsync -n -av --ignore-existing ~/photos/ /mnt/sdcard/ That "-n" means "no action"; rsync will tell you which files it would copy, but copy nothing. Remove the "-n" option when you are satisfied. That presumes I understand what you mean by the phrase "all the while ignoring the new photos". I'm guessing you want to add your main photos collection to the SD card so it can be inserted into the picture frame for display, but not to damage any photos already on the SD card. The subdirectories thing is trickier, and I suggest we tackle it later. Cheers, -- Cameron Simpson <[email protected]> DoD#743 http://www.cskk.ezoshosting.com/cs/ As you can see, unraveling even a small part of 'sendmail' can introduce more complexity than answers. - Brian Costales, _sendmail_ ------------------------------------ To unsubscribe from this list, please email [email protected] & you will be removed.Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/LINUX_Newbies/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/LINUX_Newbies/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
