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

sync --delete-after from local to remote does not delete local files #958

Closed
frallain opened this issue Mar 1, 2018 · 2 comments
Closed

Comments

@frallain
Copy link

frallain commented Mar 1, 2018

I've tried several times the following commands with s3cmd 2.0.1, 2.0.0, 1.5.0 and the files do no get removed after syncing. Is there something I am doing wrong? Is this feature broken?

$ s3cmd sync --delete-after  5 s3://dummy-test/
'5/3697/379C/2018-02-27/16/2018-02-27_16h34m04s+0000.jpg' -> 's3://dummy-test/5/3697/379C/2018-02-27/16/2018-02-27_16h34m04s+0000.jpg'  [1 of 8]
 1362078 of 1362078   100% in   14s    90.96 kB/s  done
'5/3697/379C/2018-02-27/16/2018-02-27_16h34m09s+0000.jpg' -> 's3://dummy-test/5/3697/379C/2018-02-27/16/2018-02-27_16h34m09s+0000.jpg'  [2 of 8]
 1412735 of 1412735   100% in   15s    86.91 kB/s  done
'5/3697/379C/2018-02-27/16/2018-02-27_16h35m09s+0000.jpg' -> 's3://dummy-test/5/3697/379C/2018-02-27/16/2018-02-27_16h35m09s+0000.jpg'  [3 of 8]
 1401554 of 1401554   100% in   15s    90.69 kB/s  done
'5/3697/379C/image.xml' -> 's3://dummy-test/5/3697/379C/image.xml'  [4 of 8]
 3192 of 3192   100% in    0s     5.71 kB/s  done
'5/3697/379C/video.xml' -> 's3://dummy-test/5/3697/379C/video.xml'  [5 of 8]
 1937 of 1937   100% in    0s     3.24 kB/s  done
'5/3697/37D7/2018-02-27/16/2018-02-27_16h34m04s+0000.jpg' -> 's3://dummy-test/5/3697/37D7/2018-02-27/16/2018-02-27_16h34m04s+0000.jpg'  [6 of 8]
 1568545 of 1568545   100% in   16s    90.58 kB/s  done
'5/3697/37D7/2018-02-27/16/2018-02-27_16h34m09s+0000.jpg' -> 's3://dummy-test/5/3697/37D7/2018-02-27/16/2018-02-27_16h34m09s+0000.jpg'  [7 of 8]
 1587839 of 1587839   100% in   17s    89.40 kB/s  done
'5/3697/37D7/2018-02-27/16/2018-02-27_16h35m09s+0000.jpg' -> 's3://dummy-test/5/3697/37D7/2018-02-27/16/2018-02-27_16h35m09s+0000.jpg'  [8 of 8]
 1591896 of 1591896   100% in   17s    89.53 kB/s  done
remote copy: '5/3697/379C/image.xml' -> '5/3697/37D7/image.xml'
remote copy: '5/3697/379C/video.xml' -> '5/3697/37D7/video.xml'
Done. Uploaded 8929776 bytes in 99.6 seconds, 87.59 kB/s. Copied 2 files saving 5129 bytes transfer.


$ s3cmd ls -r s3://dummy-test/5
2018-03-01 12:14   1362078   s3://dummy-test/5/3697/379C/2018-02-27/16/2018-02-27_16h34m04s+0000.jpg
2018-03-01 12:14   1412735   s3://dummy-test/5/3697/379C/2018-02-27/16/2018-02-27_16h34m09s+0000.jpg
2018-03-01 12:14   1401554   s3://dummy-test/5/3697/379C/2018-02-27/16/2018-02-27_16h35m09s+0000.jpg
2018-03-01 12:14      3192   s3://dummy-test/5/3697/379C/image.xml
2018-03-01 12:14      1937   s3://dummy-test/5/3697/379C/video.xml
2018-03-01 12:14   1568545   s3://dummy-test/5/3697/37D7/2018-02-27/16/2018-02-27_16h34m04s+0000.jpg
2018-03-01 12:15   1587839   s3://dummy-test/5/3697/37D7/2018-02-27/16/2018-02-27_16h34m09s+0000.jpg
2018-03-01 12:15   1591896   s3://dummy-test/5/3697/37D7/2018-02-27/16/2018-02-27_16h35m09s+0000.jpg
2018-03-01 12:15      3192   s3://dummy-test/5/3697/37D7/image.xml
2018-03-01 12:15      1937   s3://dummy-test/5/3697/37D7/video.xml

$ find 5 -type f
5/3697/379C/2018-02-27/16/2018-02-27_16h34m04s+0000.jpg
5/3697/379C/2018-02-27/16/2018-02-27_16h34m09s+0000.jpg
5/3697/379C/2018-02-27/16/2018-02-27_16h35m09s+0000.jpg
5/3697/379C/image.xml
5/3697/379C/video.xml
5/3697/37D7/2018-02-27/16/2018-02-27_16h34m04s+0000.jpg
5/3697/37D7/2018-02-27/16/2018-02-27_16h34m09s+0000.jpg
5/3697/37D7/2018-02-27/16/2018-02-27_16h35m09s+0000.jpg
5/3697/37D7/image.xml
5/3697/37D7/video.xml



@fviard
Copy link
Contributor

fviard commented Mar 1, 2018

I think that you have misunderstood the feature.
This option doesn't delete source files after upload but destination files that are not found anymore at the source.

The difference of this option compared to normal delete-removed is that files are deleted only once all files have been successfully uploaded instead of at the beginning before upload.

There is not "delete source files after upload" feature to avoid accidents.

@frallain
Copy link
Author

frallain commented Mar 1, 2018

OK thanks for explaining it, it was not that explicit in the usage page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants