0

I have been trying to copy a file from my remote server to AWS s3, but the file name is quite weird and I am not able to figure it out what can I do. I tried using escape characters but that did not work. Filenames:-

# R?glement de zzzzzxxxxx v1.0 #.pdf 
# R?glement de xxxxxyyyyy v1.0 #.docx

My locale is like this :-

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

I am using below command

aws s3 sync file_name s3://bucket_name/raw_files/ --sse

Please suggest

  • have you tried putting the filename in single or double quotes? – Prabhat Jun 12 '18 at 1:53
  • 1
    Note that the suspect filename character may not actually be ?, that could be just a filename displaying artifact if your system somehow doesn't propery display that character. BTW, R?glement sounds awfully close to the French Règlement. Try wilcarding the suspect chars: aws s3 sync R*glement*pdf s3://bucket_name/raw_files/ --sse (or use a more specific pattern if there are other files matching this one besides the 2 files of interest). – Dan Cornilescu Jun 12 '18 at 2:58
  • Also: what "did not work" means exactly? – Dan Cornilescu Jun 12 '18 at 3:00
  • Yes wildcarding the suspect character is working. Thanks @DanCornilescu – Prashast Jun 12 '18 at 6:31
0

Note that the suspect filename character may not actually be ?, that could be just a filename displaying artifact if your system somehow doesn't properly display that character. BTW, R?glement sounds awfully close to the French Règlement.

One possible approach to accessing those files without worrying too much about typing in those characters or escaping them would be to try to wildcard them instead. In your case try something along these lines (use a more specific pattern if there are other files matching this one besides the 2 files of interest):

aws s3 sync R*glement*pdf s3://bucket_name/raw_files/ --sse

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.