Cannot seem to run a mount
command in a .BAT
file using windows schduler or NSSM
rclone version 1.52.2
OS Windows 10 (64 bit)
cloud storage system - Google Drive
Command:
cd "C:\Portable Apps\rclone"
rclone mount Test: X:
I saved this above command as .BAT
file and try to use it in windows scheduler, but doesnt work.
Tried NSSM too even that did not work.
Tried using a .EXE
wrapper using a program called "bat2exe", even that did not work.
What did I do wrong?
any help would be appreciated.
asdffdsa
(jojothehumanmonkey)
July 24, 2020, 7:43pm
2
hello and welcome to the forum,
i can help you.
AwesomeVk47:
doesnt work
can you explain what you mean, what exactly
does not work?
first thing is to make sure that the .bat file works via the command line.
Does nothing....if I execute the batch file manually..everything works fine..but using task scheduler it just seems to do nothing
When I type in rclone mount Test: X: --log-file=C:\Portable Apps\rclone\logs --log level=DEBUG
using elevated cmd, it gives me error saying:
Command mount needs 2 arguments maximum: you provided 3 non flag arguments: ["Test:" "X:" "Apps\\rclone\\logs\\rclonemount.txt"]
I am sorry I am very new to this.
I SOLVED IT
Made a batch file with following:
cd "C:\Portable Apps\rclone"
rclone mount Test: X: --config C:\Users\MyUsername\.config\rclone\rclone.conf
Then I entered the following settings in windows scheduler:
Executed it and Behold it worked :))
but bro i still could not understand how to get that log file, i might need it in future so please tell me how to create a log file.
Hey bro the scheduling part workes like a charm using the same settings as the screenshot i gave above, but i cannot generate a log file.....sometimes its saying
--log-file not recognised as a valid flag
sometimes it says
Command mount needs 2 arguments maximum: you provided 3 non flag arguments: ["Test:" "X:" "Apps\\rclone\\logs\\rclonemount.txt"]
it even happenes when i use double quotes or just use the path to default .conf
file.
asdffdsa
(jojothehumanmonkey)
July 26, 2020, 12:27pm
12
post your command, and i will take a look at it.
When i type this:
rclone mount Test: X: --log-file=C:\Portable Apps\rclone\logs --log level=DEBUG
it says:
2020/07/27 15:39:52 Fatal error: unknown flag: --log
ncw
(Nick Craig-Wood)
July 27, 2020, 10:53am
14
AwesomeVk47:
--log level
That should be --log-level
Entering this command:
rclone mount Test: X: --log-file=C:\Portable Apps\rclone\logs --log-level=DEBUG
Gives the following error:
Command mount needs 2 arguments maximum: you provided 3 non flag arguments: ["Test:" "X:" "Apps\\rclone\\logs"]
asdffdsa
(jojothehumanmonkey)
July 27, 2020, 5:41pm
16
if logs
a folder or a file? you need specify a file
asdffdsa:
you seem to be using spaces characters for paths, something that always leads to problems.
if you are going to use those scary space characters in path, you must quote them like so
--log-file="C:\Portable Apps\rclone\logs"
https://rclone.org/docs/#windows
so try
rclone mount Test: X: --log-file="C:\Portable Apps\rclone\logs" --log-level=DEBUG
1 Like
ok bro this time the log file got saved...but the actual drive did not mount, here are the logs:
2020/07/27 23:41:45 DEBUG : rclone: Version "v1.52.2" starting with parameters ["rclone" "mount" "Test:" "X:" "--log-file=C:\\Portable Apps\\rclone\\logs\\rclonemount.txt" "--log-level=DEBUG"]
2020/07/27 23:41:45 DEBUG : Using config file from "C:\Users\Vicky\.config\rclone\rclone.conf"
2020/07/27 23:41:45 DEBUG : Google drive root '': Mounting on "X:"
2020/07/27 23:41:45 DEBUG : Adding path "vfs/forget" to remote control registry
2020/07/27 23:41:45 DEBUG : Adding path "vfs/refresh" to remote control registry
2020/07/27 23:41:45 DEBUG : Adding path "vfs/poll-interval" to remote control registry
2020/07/27 23:41:45 DEBUG : Google drive root '': Mounting with options: ["-o" "fsname=Test:" "-o" "subtype=rclone" "-o" "max_readahead=131072" "-o" "attr_timeout=1" "-o" "atomic_o_trunc" "-o" "uid=-1" "-o" "gid=-1" "--FileSystemName=rclone" "-o" "volname=Test"]
2020/07/27 23:41:45 DEBUG : Google drive root '': Init:
2020/07/27 23:41:45 DEBUG : Google drive root '': >Init:
2020/07/27 23:41:45 DEBUG : /: Statfs:
2020/07/27 23:41:46 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:3932160 Bfree:3932159 Bavail:3932159 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2020/07/27 23:41:46 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/07/27 23:41:46 DEBUG : /: >Getattr: errc=0
2020/07/27 23:41:46 DEBUG : /: Readlink:
2020/07/27 23:41:46 DEBUG : /: >Readlink: linkPath="", errc=-40
The service rclone has been started.
2020/07/27 23:41:46 DEBUG : /: Statfs:
2020/07/27 23:41:46 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:3932160 Bfree:3932159 Bavail:3932159 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2020/07/27 23:41:46 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/07/27 23:41:46 DEBUG : /: >Getattr: errc=0
2020/07/27 23:41:46 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/07/27 23:41:46 DEBUG : /: >Getattr: errc=0
2020/07/27 23:41:46 DEBUG : /: Opendir:
2020/07/27 23:41:46 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/07/27 23:41:46 DEBUG : /: >OpenFile: fd=/ (r), err=
2020/07/27 23:41:46 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/07/27 23:41:46 DEBUG : /: Releasedir: fh=0x0
2020/07/27 23:41:46 DEBUG : /: >Releasedir: errc=0
2020/07/27 23:41:46 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/07/27 23:41:46 DEBUG : /: >Getattr: errc=0
2020/07/27 23:41:46 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/07/27 23:41:46 DEBUG : /: >Getattr: errc=0
2020/07/27 23:41:46 DEBUG : /: Opendir:
2020/07/27 23:41:46 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/07/27 23:41:46 DEBUG : /: >OpenFile: fd=/ (r), err=
2020/07/27 23:41:46 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/07/27 23:41:46 DEBUG : /: Releasedir: fh=0x0
2020/07/27 23:41:46 DEBUG : /: >Releasedir: errc=0
2020/07/27 23:41:46 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/07/27 23:41:46 DEBUG : /: >Getattr: errc=0
2020/07/27 23:41:46 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2020/07/27 23:41:46 DEBUG : /: >Getattr: errc=0
2020/07/27 23:41:46 DEBUG : /: Opendir:
2020/07/27 23:41:46 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2020/07/27 23:41:46 DEBUG : /: >OpenFile: fd=/ (r), err=
2020/07/27 23:41:46 DEBUG : /: >Opendir: errc=0, fh=0x0
2020/07/27 23:41:46 DEBUG : /: Releasedir: fh=0x0
2020/07/27 23:41:46 DEBUG : /: >Releasedir: errc=0
asdffdsa
(jojothehumanmonkey)
July 27, 2020, 6:20pm
18
based on the logs, looks like the mount is working.
windows 10 can be very finicky about rclone mounts.
for each user, windows maintains two list of mounts and network shares.
one list for the user Vicky with standard permissions.
one list for the user Vicky with admin permissions.
if this is the case, i can share two workarounds.
but first, let's see if this is the problem
open two command prompts, once without admin rights, one with admin rights.
you can tell the difference by looking at the title
for each command prompt, do a dir x:
1 Like
the Admin cmd shows this:
asdffdsa
(jojothehumanmonkey)
July 27, 2020, 6:33pm
20
what does the non-admin command prompt show?