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

ascli shares - transfer-spec is not utilized #128

Open
thadu opened this issue Oct 26, 2023 · 8 comments
Open

ascli shares - transfer-spec is not utilized #128

thadu opened this issue Oct 26, 2023 · 8 comments
Assignees
Labels
customer request Request from end users

Comments

@thadu
Copy link

thadu commented Oct 26, 2023

Hi!
I am connecting to a Aspera Shares server and want to upload files. I can already upload files and folders, but using the --ts command doesn't result in the behaviour that I would expect.
I used following command on Windows, escaping all " with \:

ascli shares files upload .\testFolder --to-folder="/destinationFolder" --ts=@json:'{\"overwrite\":\"never\",\"delete_source\":true}'

Content of local testFolder:

testFolder
- testfile.txt

Content of destinationFolder:

destinationFolder
- testFolder
-- testfile.txt 

Expected behaviour:

  • "overwrite":"never" - As textfile.txt already exists in destinationFolder, it should not be replaced with the local file.
  • "delete_source": true - after upload local testFolder should be deleted.

Observed behaviour:

  • testfile.txt at destination is replaced by local testfile.txt
  • local testFolder is not deleted

Are there any issues with how I wrote the command? Are there any limitations with Aspera Shares?
Thanks in advance!

@laurent-martin
Copy link
Member

laurent-martin commented Oct 26, 2023

Did you refer to the manual, see:

https://github.com/IBM/aspera-cli#shell-parsing-for-windows

and dev version of manual:

https://github.com/IBM/aspera-cli/tree/develop#shell-parsing-for-windows

explanations are there.

In short: command line parsing on Windows is ... not as standardized as on unix-like systems...

And ascli command line tokens is parsed by the ruby interpreter itself, which is similar to Linux, and you do not need to escape double quotes...

In long: mix of old stuff from DOS, plus Windows API based on full unparsed command line execution makes that...

Backslashes are not needed, should be removed.

Now, concerning the behaviour, ascli executes ascp underneath, you can observe that with option --log-level=debug.

Shares manages the access authorization, but then transfer is direct between ascp and the HSTS (transfer server) where server side ascp also runs.

So, for a manual of ts , you may refer to the manual of ascli, there is a table there, and also using ascli

ascli conf ascp spec

Then you can refer to the manual of ascp:

https://www.ibm.com/docs/en/ahts/4.4?topic=line-ascp-command-reference

@laurent-martin
Copy link
Member

I did quick tests with Shares as you specified:

Right, source files are not deleted if they are not transfered because skipped (see ascp manual)

To delete source files even if only skipped, add: remove_skipped, so ts option would be:

{"overwrite":"never","delete_source":true,"remove_skipped":true}

Note: To get ascp logs add option : --transfer-info=@json:'{"ascp_args":["-DDL-"]}'

@thadu
Copy link
Author

thadu commented Oct 26, 2023

Thanks, I removed the backslash and the command still works.
I still can not get the overwrite option to work.

Using --log-level=debug, I can see that the overwrite option is passed to ascp:
Under the env_args:
image
Following options can be found:
image

Still, the file is uploaded to the share server and not skipped. The same file is already at the source destination. ascp logs confirm this:
image

I also tested it with uploading only the single file to the target destination. The file at destination will always be overwritten. As the file is uploaded, "remove_skipped" should not be needed and "delete_source" should delete the file at source, which it also does not.

@laurent-martin
Copy link
Member

Note that the question is not related to ascli it self, but to the behaviour of ascp which is part of the IBM Aspera SDK.

@laurent-martin laurent-martin self-assigned this Nov 4, 2023
@laurent-martin laurent-martin added the customer request Request from end users label Nov 4, 2023
@thadu
Copy link
Author

thadu commented Nov 27, 2023

Hi, is this a problem on my side, or is this an issue with ascp? Is there any information that I can provide to help to find a solution? Thanks!

@laurent-martin
Copy link
Member

Generally speaking, ascli is a front-end for ascp: For transfers , ascli interracts with the web ap (Shares, Faspex, etc..) to finally generate a transfer spec, with transfer authorization (token), and then it spawns ascp by translating this transfer spec into command line arguments to ascp.
The way ascp will manage restarts, deletions, etc.. is not managed by ascli, only ascp following the arguments provided.
And this project is not about ascp, it's ascli.
Maybe write a specification of what you want to achieve, with some clear examples.

did you try this : ?

{"overwrite":"never","delete_source":true,"remove_skipped":true}

@laurent-martin
Copy link
Member

This tiocket will be closed, if there is no news

@thadu
Copy link
Author

thadu commented Jan 2, 2024

Hi,
yes, this is my Windows cmd command:

ascli shares files upload --ts=@json:'{"overwrite":"never","delete_source":true,"remove_skipped":true}' .\testFolder --to-folder="/destinationFolder" --log-level=debug

Files from testFolder always overwrite files in destinationFolder when uploaded. See explanation in the original comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer request Request from end users
Projects
None yet
Development

No branches or pull requests

2 participants