How can I write batch sync command with a timestamp log file in Windows 10? The command I've listed below does sync properly but the log file is written as rclone_$(get-date -f yyyy-MM-dd).log
Bonus Question: Is there a way to view the rclone sync progress (triggered by the command) when the batch script is running automatically from Task Scheduler? (Maybe a command that can "Watch" the batch script?)
What is your rclone version (output from rclone version)
rclone v1.53.3
- os/arch: windows/amd64
- go version: go1.15.5
Which OS you are using and how many bits (eg Windows 7, 64 bit)
Windows 10
Which cloud storage system are you using? (eg Google Drive)
Google Drive
The command you were trying to run (eg rclone copy /tmp remote:tmp)
Sorry I didn't include the full script. The rclone commands run normally from both PowerShell and Command Prompt since I've added "rclone.exe" to the PATH.
You can now see the updated batch script in the OP.
This is a batch script, right? So it will be executed by cmd.exe, which does not understand the $(get-date -f yyyy-MM-dd).log, since this is powershell syntax. So you need to either change it to correct batch syntax: