Create new folder name with YYYYMMYY When Copy

I tried to create new folder in gdrive everydays when use copy command

rclone -vv -P copy "D:\4_Database" "mydrive:4_Database%date%"

I need create only 1 folder and name result format : YYYYMMDD
Because result %date% is : Thu 03/05/2020 (In gdrive result will slip to 3 folder Thu 03, 05 and 2020)

rclone v1.49.5
Windows 7, 64 bit
Google Drive
Thank for your help

There are some examples of how to do that sort of thing here

hello and welcome to the forum,

i am windows user and can help you.

  1. please update rclone to the latest version
  2. you should read about the flag
  3. when testing you can use this flag

in that post that mentioned by @ncw, i shared some code to create a folder with date+time stamp

here is the snippet

for /f "usebackq skip=1 tokens=1-6" %%g in (wmic Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year ^| findstr /r /v "^$") do (
set year=%%l
set month=00%%j
set day=00%%g
set hours=00%%h
set minutes=00%%i
set seconds=00%%k

set year=%year:~-4%
set month=%month:~-2%
set day=%day:~-2%
set hours=%hours:~-2%
set minutes=%minutes:~-2%
set seconds=%seconds:~-2%

set thedate=%year%%month%%day%
echo %thedate%

let me know if you have any questions.

yup! thank your fast support! ^^
I got it, Here is my command for who need

rclone -vv -P copy D:\4_Database mydrive:4_Database\2020%date:~10,4%%date:~4,2%%date:~7,2%

1 Like

that outputs 202020200305

i think you want %date:~10,4%%date:~4,2%%date:~7,2%
that outputs 20200305

1 Like

yup! sorry, I have mistake when posted

1 Like

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