RSS

 
WinEdt Macro Library  | LaTEX previous macro  | next macro

Backup

Description

This macro will back up all the tex files in your mainfile directory (incl. subdirectories). The backup macro is triggered each time you save a file or compile the project but will be executed only if the last backup is older than 5 minutes. A secondary backup is also performed where all of the files are backed up regardless of their file extension, but this "big" backup is performed at most only once a week.

The minimal age of both backup-methods can be easily adjusted to your needs at the beginning of the macro file.

In the folder of your main file a new folder will be created by the name "Backup". In there you will find the continuous backup folder and the complete backup folder. The archive files in these folders are named after the date and time of their creation. There will be also two files by the name "last", do not delete them as the time of the last backup is saved in those files.

Note: After many hours of trial and error I found the best settings for 7-zip to generate the smallest file sizes possible. These settings vary for the continuous and the complete backups.

Requirements

7-zip must be installed (from www.7-zip.org)

Installation

  • Save the file Backup.edt in %b\Macros\LaTeX\ (where %b is the User Application Data Folder (eg. C:\User\WinEdt or C:\Users\User\AppData\Roaming\WinEdt)
  • If %b\Local\Events\MDISave.edt does not exist:
    • create it (an empty file; create the folder if necessary)
  • Add the following line to %b\Local\Events\MDISave.edt:
    Exe("%b\Macros\LaTeX\Backup.edt");
    

Download

LaTeX/Backup.edt

Macro contributed by U-Jean <ygn2kgmx.net>

WinEdt Macro Library  | LaTEX previous macro  | next macro