-
Notifications
You must be signed in to change notification settings - Fork 4
Upload and download files #136
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
Open
onnozweers
wants to merge
11
commits into
master
Choose a base branch
from
94-upload-download-files-with-ada
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Implement --upload, including --verify-checksum * Improve debug messages in get-webdav-door * New function exists() tells whether a path exists in dCache (file/dir)
* Implemented ada --download function, including checksum verification * Created get_checksum function, to get a single checksum * Created get_local_checksum function, to get a checksum of a local file * Fixed rogue header from a curl command * Removed --verbose from curl when debugging; output is too overwhelming
Before this commit, an example command was provided, but in many cases copying and pasting the command wouldn't work. With this commit, a command is printed that will work in all cases (AFAIK). I stole some lines of code from Haili and adapted them a bit (to fix shellcheck warnings and improve layout).
* Use 'curl --proto =https' to prevent unsafe redirects * Allow override with --allow-insecure-redirects * Fix handling of https://webdavdoor/dir/file URLs * When uploading or downloading target exists, and --verify-checksum is specified, we check the checksum of source and target. This was already implemented, but not for all cases. I hope I covered all cases now.
Contributor
Author
|
Some examples: UploadingUploading but target existsUploading with checksum verificationUploading with checksum verification has the side effect that the uploaded file has both an Adler32 (default in dCache) and an MD5 checksum. Uploading with checksum verification and target existsDownloadingDownloading but local file existsDownloading with checksum verificationFirst a checksum failure because the target file exists but it's a different file. Then removing it and trying again. Downloading, but remote file is not online |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
--uploadand--downloadhttps://webdav.example.com/remotepath/remotefile)--verify-checksum, compare the checksum of the transferred file with the source file. During upload, the local file's MD5 checksum is sent as a header in the transfer, so that dCache can do the verification. The MD5 checksum is stored in dCache's database, along with the default (Adler32) checksum. In case of MD5 mismatch, the uploaded (corrupt) file is cleaned up.--verify-checksumis specified: in that case, compare the checksums of source and target.--allow-insecure-redirectsis used.