Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Listing and deleting files from surfer CLI

    Surfer
    3
    8
    223
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ruihildt
      ruihildt last edited by

      Is it possible to list remote files and delete them with the surfer CLI?

      When doing quick updates/testing, I now need to either go through the web terminal or the web interface.

      It would be nice to be able to do everything from the same interface. (Maybe it's implemented but not documented?)

      1 Reply Last reply Reply Quote 0
      • girish
        girish Staff last edited by

        $ surfer
        Usage: surfer [options] [command]
        
        Options:
          -V, --version                output the version number
          -s, --server <url>           Server URL (optional)
          -t, --token <access token>   Server Access Token (optional)
          -h, --help                   display help for command
        
        Commands:
          login [options] <url>        Login to server
          logout                       Logout from server
          put [options] <file|dir...>  Puts a list of files or dirs to the destination. The last argument is destination dir
          get [file|dir]               Get a file or directory listing
          del [options] <file>         Delete a file or directory
          help [command]               display help for command
        

        Is surfer get and surfer del what you want?

        ruihildt 1 Reply Last reply Reply Quote 1
        • ruihildt
          ruihildt last edited by

          I didn't think of typing just the app name, I was just looking at the documentation. 😅

          I suggest to add this info to the cloudron surfer app doc, it might help inattentive people like me.^^

          1 Reply Last reply Reply Quote 1
          • ruihildt
            ruihildt @girish last edited by

            @girish I just tried deleting the whole files with surfer del /, surfer del * and surfer del /*, whoc doesn't work.

            Is there a way to delete everything at once?

            1 Reply Last reply Reply Quote 0
            • nebulon
              nebulon Staff last edited by

              Indeed attempting to remove the root folder contents does not work and also does not report an error. I am anyways improving the cli just now so I will fix this for the next version. Please note that using * here is a bit tricky as the shell might expand that for the local files!

              1 Reply Last reply Reply Quote 0
              • girish
                girish Staff last edited by

                surfer del -r dir works. I guess we need to make surfer del -r / work.

                ruihildt 1 Reply Last reply Reply Quote 0
                • ruihildt
                  ruihildt @girish last edited by ruihildt

                  @girish I didn't try with -r parameter, so it probably works, it's just that it's not in the documentation. Is Surfer CLI based on a known CL implementation I can read on?

                  1 Reply Last reply Reply Quote 0
                  • nebulon
                    nebulon Staff last edited by

                    Removing the root ala / does not work. I have to fix the code. The code is at https://git.cloudron.io/cloudron/surfer/-/tree/master/cli

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB