writebackup version 1.40 from 29-Dec-2018: ENH: Allow to do only a single backup each day via --once-today. writebackup version 1.30 from 09-Sep-2017: ENH: Allow to remove the original file via --delete-original. writebackup version 1.20 from 13-Apr-2012: Allow different backup dir in Bash version. writebackup version 1.13 from 03-Jun-2010: Removing execute permissions on the backup. writebackup version 1.12 from 25-Nov-2009: BUG: Checking return status of 'cp' comand. writebackup version 1.11 from 28-Apr-2009: Converted Korn shell script to Bash. writebackup version 1.10 from 11-Sep-2007: Zipping directories into a single-file backup. writebackup version 1.00 from 10-Mar-2007: First published version.
The writebackup script writes subsequent backups of the current file with a current date file extension (format .YYYYMMDD[a-z]) in the same / passed backup directory. The first backup of a day has letter 'a' appended, the next 'b', and so on. (Which means that a file can be backed up up to 26 times on any given day.)
Directories will be zipped (individually) into an archive file with date file extension. For example, a directory foo will be backed up to foo.zip.20070911a. This zip file will only contain the foo directory at its top level; foo itself will contain the entire subtree of the original foo directory (including system and hidden files).
For Microsoft Windows, you can use the VBScript version writebackup.vbs. The shell script writebackup.sh is a Bash shell script, which can be executed on Linux or Unix systems, or under Cygwin.
C:\Temp>dir /b foo.txt C:\Temp>writebackup.vbs foo.txt C:\Temp>dir /b foo.txt foo.txt.20070315a C:\Temp>writebackup.vbs foo.txt C:\Temp>dir /b foo.txt foo.txt.20070315a foo.txt.20070315b
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License.