Incremental backup from batch file

Hello to all,

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 ?

Best regards.

This is rclone forum. For rsync issues contact their community.

Sorry for the mistake, I would say "RClone" :slight_smile:

OK. Then please provide all details as per template. So somebody maybe can help

Actually, that's what i got on my batch file :

rclone.exe sync "SCZ_OneDrive:/grille_import_verins_christianOK.xlsx" "GADEK_GDrive:/tarifs_incrementals_backups" --backup-dir "GADEK_GDrive:/tarifs_incrementals_backups/copie_$(date +%d%m%Y%H%M)"
timeout /T 5 > nul

And what is the problem with it?

It works but I cannot pass the date to the incremental backup folder...

Again in order to get help please provide all info as asked in the template.

Nobody is going to keep guessing what the issue is.

Some example would help to:

  1. What you are doing
  2. What you expect to happen
  3. What happens

$(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

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