Sunday, December 19, 2010

[LINUX_Newbies] Re: Newbie looking for help

 

On 17Dec2010 22:41, chipandfamily <chipandfamily@yahoo.com> 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 <cs@zip.com.au> 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_

__._,_.___
Recent Activity:
To unsubscribe from this list, please email LINUX_Newbies-unsubscribe@yahoogroups.com & you will be removed.
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


Be a homeroom hero! Help Yahoo! donate up to $350K to classrooms!


Get great advice about dogs and cats. Visit the Dog & Cat Answers Center.

.

__,_._,___

No comments:

Post a Comment