S3Sync.net
February 02, 2014, 01:28:21 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Search
Login
Register
S3Sync.net
>
General Category
>
Questions
>
Weird behavior of --delete option.
Pages: [
1
]
« previous
next »
Print
Author
Topic: Weird behavior of --delete option. (Read 2294 times)
lejarrag
Newbie
Posts: 16
Weird behavior of --delete option.
«
on:
October 15, 2007, 04:34:27 PM »
When I download from Amazon S3 using a trailing slash in the source address, s3sync tries to delete the whole directory that I am downloading. For example, suppose I upload first the directory dir:
./s3sync.rb -r --delete /root/tmp/dir bucket:pre
Here everything works fine and some keys pre/dir, pre/dir/file1, pre/dir/file2, etc are created in "bucket", whereas other stuff is deleted. Now if I try to download:
./s3sync.rb -r --delete bucket:pre/dir/ /root/tmp/dir
it downloads the stuff as it should, but it warns me with the message:
"Could not delete directory /root/tmp/dir: directory not empty"
This warning is not totally idle: if the directory happens to be empty, it erases it. It seems to me that this shouldn't happen. The above command should just copy the "files and directories" with prefix "pre/dir" to /root/tmp/dir, deleting files and directories in /root/tmp/dir that don't appear in S3, but not try to delete the directory /root/tmp/dir. I tried different variations on this, and the culprit seems to be the trailing slash /.
Workaround: don't use the trailing slash. The command
./s3sync.rb -r --delete bucket:pre/dir /root/tmp
seems to work fine with no warnings. The only disadvantage is that you can't rename dir to something else (say dir2) within the s3sync command.
I'll appreciate any clarification or discussion on this. There may be some logical explanation for this that I can see at the moment.
«
Last Edit: October 15, 2007, 10:34:37 PM by lejarrag
»
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Announcements
=> Questions
=> General Discussion
=> Report Bugs
===> Closed Bugs
=> Feature Requests
Loading...