Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: --delete-local option on "archive upload" #9

Closed
ghost opened this issue Nov 2, 2012 · 4 comments
Closed

Feature Request: --delete-local option on "archive upload" #9

ghost opened this issue Nov 2, 2012 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 2, 2012

It would be great to have an option on the "upload" command to delete the local copy of the file after a successful upload. Maybe a "--delete-local"????

I am encrypting my files before uploading to Glacier (like everybody). Therefore, after the file is uploaded I don't need the local file anymore. The deletion of the file also indicates that the file has been uploaded. This means I can interrupt an upload script and restart without duplicating uploads.

I need to be able to interrupt my upload script sometimes because I need my uplink bandwidth for other purposes.

Further info: I am uploading my 80GB of photos as individual encrypted files via a slow 2Mbps link. I am using a basic 'find' to recurse down my directory tree, with an -exec to encrypt, upload, delete encrypted file. Interrupting my simple 'find' and restarting leads to duplicated files. Adding the above option, would allow me to create an encrypted cache of my files, and upload when convenient. If it's deleted then it was successfully uploaded.

@basak
Copy link
Owner

basak commented Nov 2, 2012

Sounds like a reasonable need.

I've been careful to make sure that glacier-cli only returns success only when the upload is successful, and it would be a bug if there's any case where it doesn't do this.

Given that you are calling glacier-cli from a script anyway, is there any reason why you can't do something like this?

glacier archive upload vault filename && rm filename

The rm filename will only execute if glacier-cli returns success.

If this works for you, I'd prefer to keep glacier-cli within the Unix philosophy of doing one thing well, and leaving it to the caller to put it together with other tools as necessary. But if this is awkward for some reason that I'm missing, or if there is some other reason for which we need it, then I'll be happy to add something like a --delete-local option.

@basak
Copy link
Owner

basak commented Nov 2, 2012

Incidentally, I'll be adding automatic upload resume functionality soon. You may find this useful. Just waiting on a pull request in boto.

@ghost
Copy link
Author

ghost commented Nov 5, 2012

Yep I can use a script &&. I can't think of a good reason not to, especially now I know the return codes are properly returned by glacier-cli.

Many thanks for the tip. If I run into a road block I will re-request the feature.

@ghost ghost closed this as completed Nov 5, 2012
@basak
Copy link
Owner

basak commented Nov 5, 2012

OK, but one warning. Although the intent is to make sure that the exit status is only zero if the upload was successful, there may be bugs anywhere in the stack. Eg. glacier-cli, boto, python's httplib, etc. Please remember that there's no warranty, and test your particular use cases!

sakoht pushed a commit to pkaleta/glacier-cli that referenced this issue Jan 14, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant