I actually launch a rclone command from a Microsoft One Drive directory to a Google Drive directory from a batch file. It's work well but I would like to make incremental backups. I read all the posts on 'incremental backups' on the forum but it definitively not work for me....
Could someone help me please ?
$(date +%d%m%Y%H%M), that is for linux, not windows.
on windows, for .cmd batch, try something like
@for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I
@set datetime=%datetime:~0,4%%datetime:~4,2%%datetime:~6,2%.%datetime:~8,2%%datetime:~10,2%%datetime:~12,2%
@echo %datetime%
20230919.082705
so try something like --backup-dir GADEK_GDrive:/tarifs_incrementals_backups/copie_%datetime%
Thanks @asdffdsa . I finally try a different way and it works fine !
Here is my script :
set CUR_YYYY=%date:~6,4%
set CUR_MM=%date:~3,2%
set CUR_DD=%date:~0,2%
set CUR_HH=%time:~0,2%
if %CUR_HH% lss 10 (set CUR_HH=0%time:~1,1%)
set CUR_NN=%time:~3,2%
set CUR_SS=%time:~6,2%
set CUR_MS=%time:~9,2%
set SUBFOLDNAME=_%CUR_DD%-%CUR_MM%-%CUR_DD%-%CUR_HH%:%CUR_NN%:%CUR_SS%
rclone.exe sync "SCZ_OneDrive:/grille_import_verins_christianOK.xlsx" "GADEK_GDrive:/tarifs_incrementals_backups" --backup-dir="GADEK_GDrive:/tarifs_incrementals_backups/backup"%SUBFOLDNAME%
timeout /T 5 > nul