Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.7: Auto-copy Photo Stream images to a folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.7: Auto-copy Photo Stream images to a folder
Authored by: arcticmac on Feb 04, '12 01:28:52AM

Just for the instructive value, this is also pretty easy to do on the command line with 'find' (for looking for files) and 'xargs' (for executing the copy). Now, if what you're after is to copy the files, then you want something like

find srcdir -iname *img* -print0 | xargs -0 -J % cp % destdir

But it might be more elegant (no idea how it works with iCloud) to use symlinks instead:

find srcdir -iname *img* -print0 | xargs -0 -J % ln -s % destdir

Basically, what this does is to use 'find' to locate files whose name matches the regular expression *img* (case insensitive, since I used -iname instead of -name), and then sends them to xargs, which takes them in batches and executes cp or ln -s with them. the "-print0"/"-0" pair is important when filenames have spaces in them, which they often do.

For bonus points, this should even work with mdfind, in case you want to take advantage of a your spotlight index to do even more advanced searches.



[ Reply to This | # ]
10.7: Auto-copy Photo Stream images to a folder
Authored by: gurb on Feb 04, '12 05:35:40PM
Interesting, and a very nice tip. Kudos to DJF3.
I guess if your $HOME variable points to the right place you can do without srcdir and use:

find $HOME/Library/Application\ Support/iLifeAssetManagement/assets -iname *img* -print0

Now you can xargs to copy into ~/Pictures which should be empty, right (C:

[ Reply to This | # ]