Giter Site home page Giter Site logo

Create folders about cloudsend.sh HOT 6 CLOSED

tavinus avatar tavinus commented on August 16, 2024
Create folders

from cloudsend.sh.

Comments (6)

tavinus avatar tavinus commented on August 16, 2024 1

Hey @MuellerSeb ,

v2.2.0 is out and is the first version that can send folders.

https://github.com/tavinus/cloudsend.sh/releases/

Can you test it for me please?

Cheers!

from cloudsend.sh.

tavinus avatar tavinus commented on August 16, 2024 1

Just pushed v2.2.1 with some fixes to the log messages.

Cheers

from cloudsend.sh.

MuellerSeb avatar MuellerSeb commented on August 16, 2024

Maybe with:

curl -X MKCOL

That is also done by pyocclient:
https://github.com/owncloud/pyocclient/blob/72a6666d7b9d022b5ee573a9d2568a0547823351/owncloud/owncloud.py#L702

from cloudsend.sh.

tavinus avatar tavinus commented on August 16, 2024

Hi. Thanks for the info.

Something like this seems to work:

/usr/bin/curl -X MKCOL -u '2hsB1zw2q4frZsg:' -H 'X-Requested-With: XMLHttpRequest' 'https://cloud.mydomain.tld/public.php/webdav/TESTFOLDERNAME'

This opens the possibility to send the tree, but we still need to iterate through each file and subfolder, creating each folder and sending each file to its destination. This needs to traverse the whole tree, making a curl call to each item (file/folder).

I am still checking if I can make curl do the hard lifting, it is not looking good though.

My cloudmanager program also has this as a pending problem (sending entire folders).

I tried using curl --ftp-create-dirs with find, but that does not seem to work in this case. ( Reference )

I think the proper way would be to have 2 recursive functions. The first would traverse all subfolders and create them at the target, while the second would traverse all files and send them, each to its proper subfolder.

We can probably just make 2 calls with find -exec curl (one for folders, one for files).
I will keep testing...

Edit: I am implementing it. It is a bit complex, so it will take a bit of time. Also, I will probably need readlink -f, which is not present in MacOS/BSD systems. I have a bash implementation of it in my pdfScale app. Seems like I will need it only when the current folder is passed to be sent, so I may be able to use PWD / $pwd instead. Seems like it will work, currently it already creates all the folders, but I still need to add a lot of error checkings and change the behaviour of older things. Also, it may be a bit slow to send a large tree and I am still figuring out how to log all of that to screen, if I should list all and ask before sending, etc, etc.

from cloudsend.sh.

tavinus avatar tavinus commented on August 16, 2024

I have it almost done.

It is fully working already.

Just cleaning up, making some more tests, fixing messages and some other minor things.

The curl --progress-bar "Spaceship Bar" span multiple lines in some systems, which was quite the pain to debug. I ended up fixing the BAR in a maximum of 80 Columns and that seems to solve the problem. This is not a critical bug, but it totally breaks the output when it happens.

Things like
image

The same thing would happen when calling curl directly.

This should have been fixed here: curl/curl#4849
It will probably take some time until it reaches most OSes, so I will keep it like this.

This is how it is working at this moment
image

It first creates all folders and then sends all files. The folder calls do not use curl's progress-bar (thank god), It just prints OK when Done or the error message from the XML (may need to refine for curl errors as well). The file sending part will display curl's progress-bar for each file.

This is how it looks like if the folders already exists.
image

It will overwrite existing files as it does in a single file send.

I will be pushing it soon...

from cloudsend.sh.

tavinus avatar tavinus commented on August 16, 2024

Hi. It's been a couple of months without reply, so I will close this.
Feel free to post again or reopen if needed.

Cheers!
Gus

from cloudsend.sh.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.