Serve local forlder as WEBdav silently

What is the problem you are having with rclone?

Trying to serve a local folder as WebDAV using a .bat file to run at startup.
I want to do this silently, but can't get it to work. I don't want a console window open, I need it running 24x7

Run the command 'rclone version' and share the full output of the command.

rclone version                                                             19 
rclone v1.62.2
- os/version: Microsoft Windows 11 Pro 22H2 (64 bit)
- os/kernel: 10.0.22621.1555 Build 22621.1555.1555 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

NA, I'm using a local filepath

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Startup_WebDAV.bat =>

@echo off
@rclone serve webdav --no-console --quiet  "D:\path\to\directory"

The rclone config contents with secrets removed.


empty file, I'm not using anything, its a fresh install on windows.

A log from the command with the -vv flag

This is opposite of what I'm trying to do but...

2023/04/20 18:39:21 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "serve" "webdav" "-vv" "D:\path\to\directory"]
2023/04/20 18:39:21 DEBUG : Creating backend with remote "D:\path\to\directory"
2023/04/20 18:39:21 DEBUG : Using config file from "C:\\Users\\[USERNAME]\\AppData\\Roaming\\rclone\\rclone.conf"
2023/04/20 18:39:21 DEBUG : fs cache: renaming cache item "D:\path\to\directory" to be canonical "//?/D:\path\to\directory"
2023/04/20 18:39:21 INFO  : Local file system at //?/D:\path\to\directory: poll-interval is not supported by this remote
2023/04/20 18:39:21 NOTICE: Local file system at //?/D:\path\to\directory: WebDav Server started on [http://127.0.0.1:8080/]
2023/04/20 18:39:27 INFO  : Signal received: interrupt
2023/04/20 18:39:27 DEBUG : 4 go routines active
Terminate batch job (Y/N)? y

Try this flag

  --no-console   Hide console window (supported on Windows only)

Hi Nick, as you can see in my OP, I already use it. it opens a console which if closed quits the server.

You 'think' you are using it but in reality, you are not.

You can see in the log, it is not there.

-- cannot be run with no-console, hence I had to remove it as -vv was a requirement for opening a ticket.

using -vv with no-console gives an error they cannot be run together.

I appologise, the error was It can't be run with quiet, nothing with no-console, but the console shows up, so it serves no purpose.

 utkarsh    ~  ﮫ0ms⠀   rclone serve webdav -vv --no-console --quiet "D:\path\to\directory"
2023/04/20 21:33:56 Can't set -v and -q
 utkarsh    ~  ﮫ464ms⠀   rclone serve webdav -vv --no-console "D:\path\to\directory"
2023/04/20 21:34:07 DEBUG : rclone: Version "v1.62.2" starting with parameters ["C:\\Users\\utkar\\AppData\\Local\\Microsoft\\WinGet\\Packages\\Rclone.Rclone_Microsoft.Winget.Source_8wekyb3d8bbwe\\rclone-v1.62.2-windows-amd64\\rclone.exe" "serve" "webdav" "-vv" "--no-console" "D:\path\to\directory"]
2023/04/20 21:34:07 DEBUG : Creating backend with remote "D:\path\to\directory"
2023/04/20 21:34:07 DEBUG : Using config file from "C:\\Users\\utkar\\AppData\\Roaming\\rclone\\rclone.conf"
2023/04/20 21:34:07 DEBUG : fs cache: renaming cache item "D:\path\to\directory" to be canonical "//?/D:\path\to\directory"
2023/04/20 21:34:07 INFO  : Local file system at //?/D:\path\to\directory: poll-interval is not supported by this remote
2023/04/20 21:34:07 NOTICE: Local file system at //?/D:\path\to\directory: WebDav Server started on [http://127.0.0.1:8080/]
2023/04/20 21:34:13 INFO  : Signal received: interrupt
2023/04/20 21:34:13 DEBUG : 4 go routines active

The one thing it does seem to do, is minimise the window.

-quiet means do not log things and doesn't work with debug logging as we want to see everything.

I'm a bit confused.

Running -vv and --no-console and you still get a console to show up?

Yes you understand correctly, all that happens in it minimises.

Doesn't work even if redirect output.

@echo off
@rclone serve webdav --no-console -vv "D:\path\to\directory" >nul 2>&1

Yeah, that's what is supposed to happen.

Rclone launched it's own process and did not start a console.

It's not forking process so you see rclone is 'running'.

If you search the forums, there are multiple examples for Windows out there to do what you want.

Maybe @asdffdsa will tell you too.

I tried searching, maybe with the incorrect search terms. I appreciate any help in suppressing any console from popping up.

Not a windows guy per se, but if you search

"windows nssm"
"windows task scheduler"

Give us a slew of results as those are a few I am aware of.

1 Like

Yes that is what --no-console does.

It is possible for rclone to launch without a console, but it requires recompiling it.

However I suspect that a task manager is what you really want.

1 Like

For anyone who lands here.

from https://forum.rclone.org/t/autostart-mount-on-windows-without-cmd-popping-up/20896/2?u=utkarshsethi

This seems to work.

that would be the easiest way.

  1. create a task in task scheduler, let's call it cloud.daily
  2. run the task via .lnk shortcut

C:\Windows\System32\schtasks.exe /run /tn "rclone\cloud.daily"

So I was already using task scheduler to run the script, the only thing I did different was use the default setting to run it when the user is logged in.

image

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.