S3Sync.net
February 02, 2014, 01:19:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Weird behavior of --delete option when downloading with trailing slash.  (Read 4300 times)
lejarrag
Newbie
*
Posts: 16


View Profile
« on: October 18, 2007, 09:28:13 AM »

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 /.
Logged
ferrix
Sr. Member
****
Posts: 363


(I am greg13070 on AWS forum)


View Profile
« Reply #1 on: November 17, 2007, 08:41:13 PM »

Fixed @1.2.1
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!