S3Sync.net

General Category => Feature Requests => Topic started by: Charlie on May 25, 2007, 12:28:09 AM



Title: --mayi
Post by: Charlie on May 25, 2007, 12:28:09 AM
Hi Ferrix,

first as always, great util !!

I have used it to backup about 15k photos and the collection is continually growing (1400 photos/4,7GB for the last outing). What I am now starting to dearly miss is a way to tell S3Sync not to backup certain photos (not 100% in focus; wrong person in frame and all that kind of thing; I still have them on the local hd, but if my flat burns down losing them would be the least of my problems).

THUS: --mayi "mayiuploadfile %1"
which would call the external program 'mayiuploadfile %1' with the path+filename of the file about to be uploaded as it's parameter and depending on it's exit code S3Sync will upload the file to S3 or skip it. Thus 'mayiuploadfile' could be a shell script or an assembler program that knows what file it expects and processes it accordingly (creating this program is left as an exercise to the reader).

This feature would let me tag the photos that i want uploaded to S3; someone else might use it to only upload files newer than a certain date ("mayiuploadfile -newer 20070101 %1") or only upload mp3's with at least a bitrate of 128kb/s ("mayiuploadfile -eqgt 128 %1") or whatever else they feel like.

Thanks for your consideration of this feature and regards
  charlie


Title: Re: --mayi
Post by: ferrix on May 25, 2007, 01:45:25 AM
Trippy idea.


Title: Re: --mayi
Post by: Charlie on January 05, 2009, 05:19:35 PM
Trippy idea.

Hi Ferrix,

attached a diff for the --mayi idea. The knowledgeable program must return an error code of 0 if it wants the file to be uploaded to s3. Anything else and the file will not be uploaded. I chose this way as if the knowledgeable program is missing or produces any other kind of error the file will still be backed up.

the syntax of mayi changed a bit since my first request in that it takes '%s' instead of '%1' as this was easier with me not really knowing ruby.

I now have:
s3sync.rb -s -r --delete --mayi="isstarred.py %s" <dir> <bucket>
in my upload scripts. the python script only returns 0 for images with a IPTC rating of 1 and above which does wonders for the amount of data I need to upload :-)

regards
  charlie


Title: Re: --mayi
Post by: ferrix on January 06, 2009, 02:24:21 PM
FYI to anons: you have to log in to see the attachment.