[script] Simple Backup System for RJ TE

Ask questions about how to create a script or swap scripts with other users.
Post Reply
User avatar
pjj
Posts: 1784
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

[script] Simple Backup System for RJ TE

Post 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 406 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:
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus

User avatar
pjj
Posts: 1784
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: [script] Simple Backup System for RJ TE

Post 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%
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus

Post Reply