Page 1 of 1

[script] Simple Backup System for RJ TE

Posted: 29 Jan 2015 17:35
by pjj
Thanks to Rickard's fantastic support for script development (and his terrific editor in general!), I am now able to present quite elaborated script for backing up your source files, hoping you will find it useful.

Goal of Simple Backup System for RJ TextEdit (SBS) is to store, depending on your configuration and backup mode you've chosen, all or some files located in a given project directory and its subdirectories. The archive is saved into #backup subdirectory. There are two modes for backup: full and partial. Archive files have timestamps in their names, and each run (backup type, date & time, comment) is also logged into a text file for a quick reference. -- This is, of course, not a full-blown versioning system, but I hope it will come in handy nevertheless.

I tried to painstakingly describe everything related to SBS, so please refer to readme.txt file contained in the SBS archive, available to download below. Please notice that you need RJ TE in version at least 10.20 to run this script.
sbs-1.0.zip
(5.98 KiB) Downloaded 482 times
(re-uploaded to the new forum; previously downloaded 15 times)

If you have any comments or feature requests, please write them in this thread.

SBS is licensed as beerware :wink:

Re: [script] Simple Backup System for RJ TE

Posted: 25 Apr 2018 07:53
by pjj
Funny thing, but if you run backup script before noon, with some locales filename could be corrupted: time part (and, which is worse, file extension) could be completely omitted due to a space leading hour digit (instead of 0); to correct this, just change one line:

Code: Select all

SET archive_name=%date:/=%@%time:~0,2%h%time:~3,2%m
with these two:

Code: Select all

FOR /F "tokens=1-2 delims=/: " %%a in ("%TIME%") DO (if %%a LSS 10 (SET time=0%%ah%%bm) else (SET time=%%ah%%bm))
SET archive_name=%date:/=%@%time%