I need help creating versioning with crypt to dated folders

as for wget, i use it for many years and no need for that bloated windows linux subsystem.

  1. http://gnuwin32.sourceforge.net/packages/wget.htm
  2. https://www.cygwin.com/

i have two home servers, both running windows free hyper-v server.
one is a file and media server and one is a backup server.
on that backup server, i have free edition of veeam backup and replication, instant recovery and all the good stuff.

So, what should the "finished" code look like, in this section, with the potential bug?

So, what should the "finished product" look like?
Is this the part of the code, with the issue?
:: Now let us sync. This makes a mirror of sourcepath to destpath (including removing files if required), and any files that get "overwritten" or "deleted" as a
:: result from destpath, will be moved into archive and and timestamped instead - effectively creating a full archive of all revisions of files you have ever had.
%rclonepath%\rclone sync "%sourcepath%" "%destpath%" --backup-dir="%archivepath%%currentDate%---%currentTime%" --fast-list -P --drive-chunk-size 64M --log-file="%logfile%" --log-level="%loglevel%"
echo:

  1. here is the comparison https://www.veeam.com/products-edition-comparison.html
    from that i would say you can instant recovery to esxi server.
  2. yes, veeam can do bare metal restore and inject new hardware drivers. i have used acronis for many years and it is great at bare metal recovery. again, as i do not use vmware, you should do some research and testing.
  3. vmware should have some kind of backup for the server itself, configuration and so on.
  4. virtual machines are just files, that can be copied, with any file manager or command line.

I will see if I can update the code today to fix the points mentioned by asdffdsa.
If you have any problems using that as-is then I suggest you just ask.
It should just involve changing the -settings- part of the script. If I have overlooked anything just point it out. Better that we fix it in the posted script (so it can be more robust and useful to others) than you having to finagle it yourself to get it to work.

Will update later.

1 Like

Thanks.

Now to just create a GUI so we can just drag and drop our variables in, set the schedule, and click go. :smile:

so you have data stored on the synology box you want to backup?

you can use the built-in synology software to backup to the cloud?

so why do you want to use a windows server to backup that data?

A bit late as usual - but im starting on it now... will edit soon.

i am looking forward it!

Done

@Charles_Hayes Take a look there (up in the earlier post)
I updated the previous post to have the new script 1.1 in it. It should fix all the issues mentioned by asdfdsa earlier. If I missed anything, let me know.

Do note that you should NOT need to mount the drive to run this. That will only make this run slower actually.
I figure you maybe misunderstood that 2 of the settings actually expect the name of your rclone remote.
I made that more explicit in my examples, so check that again. If that doesn't make it clear then I suggest you just ask. If it's not understandable to you then we just need to document it even better :slight_smile:

Missing logfile name: Fixed. Logfile is now set to date+time.log
New variable for flags: added to settings.
Date format: Changed (reversed) to yyyy.mm.dd

+various minor simplifications and cleanup to make it more readable.

nice, much improved.

  1. to run rclone.exe from a batch file and use --progress, you need start /w rclone.exe else you will get an error in the log file.
  2. the exit code is always 0
    perhaps
if %ERRORLEVEL% equ 0 (
    echo Sync completed sucessfully!
    exit /b 0
) else (
  echo rclone reported an error during the sync
  exit /b 1
)
  1. this is how i calculate date and time

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 day=00%%g
set hours=00%%h
set minutes=00%%i
set month=00%%j
set seconds=00%%k
set year=%%l
)
set month=%month:~-2%
set day=%day:~-2%
set hh=%hours:~-2%
set mm=%minutes:~-2%
set ss=%seconds:~-2%
set date=%year%%month%%day%_%hh%%mm%%s%

echo %date%

which will output
20191109_1656

You sure? No errors in my logfiles here. Not sure I see why running it directly in the script would be an issue. Can you elaborate on what error might occur?

Sure, that's easy enough to add. I didn't really focus on having proper errorcodes here since it's probably not something the OP would use, but I agree it should be added for completeness in case someone wanted to call it from another script. I will fix. EDIT: fixed 1.2 - replaced old code in original post.

That's nice and clean ,but do you see any reason to change it from what it is currently? I believe the current code should yield correct results. Didn't really see the need to split it up any further in this case, even though that would probably render it more customizable.
The timestamp format right now is yyyy.mm.dd_hh.mm

have you run and tested the code?
the output of FORMATTIME seems to be
..Sat 11/09/2019_17.21

Of course I've tested.
I'm not sure what you mean - the reserveDate and currentDate set in FORMATTIME comes out as

C:\rclone\Scripts>archivesync.bat
2019.11.09
23.27

If you get something so radically different hmm... is it because you use some other locale format in Windows? Mine certainly doesn't have any "name of week-day" in it. Does that reflect what is given by %time% ? If so this is not something I thought about... I assumed %time% was a fixed format. If this is a problem I probably have to find a way to source this more reliably.

EDIT: if you are reasonably sure your source does not share the same issue I will just use that instead.

EDiT2: Ok yea, this is a local problem it seems. From Stackoverflow:
The %date% will give different string with different locale. – [AechoLiu](https://stackoverflow.com/users/419348/aecholiu) Nov 12 '13 at 9:04

compared to start without /w ?
or compared to direct-run as I do here?

I mean, I could always add that, but I can't replicate the issue for myself, and I'd like to know the problem before adding a workaround.

i think that there is been a recent bug fix so i might not be a problem anymore.

date and time on windows batch file has ALWAYS been a nightmare for many decades.
what a nightmare

Ah, cool. That explains it. I was getting very confused because my logs worked fine and had the -P output in them without any errors.

I have read up on WMI and %date% timelocal problems. I now see that your solution is clearly more robust - so I've just replaced that datecalculation with yours. I've just never noticed I guess because I usually only make batchscripts for myself, but I will use this from now on myself. Thanks for learning me something useful :slight_smile:

Just doing a quick retesting before adding v1.3

let me know v1.3 is ready and i get started on 1.4.
i think an emoji is needed here, wink or something

Stop tying to kill me Jojo... geeeez :slight_smile:

1.3 added - improved timestamp, no longer relies on locale-settings on the OS
added benefit: much easier to customize timestamp to preference.

@Charles_Hayes definitely recommended so you don't end up getting weird timestamp like asdffdsa did.