Sublime Forum

Automatic Backup Plugin

#1

(recreating accidentally-deleted topic. See sublimetextwiki.com/cgi-bin/ … kupsPlugin)

“Automatic Backups” is a plugin by SteveCooper.

When you edit text files (scripts, prose, whatever) you often find yourself wishing for an older version. This plugin takes a copy of every file you save and copies it into a backup directory structure, ensuring that you never lose an old version of the file.

You can download the plugin from sublimetextwiki.com/SteveCoo … gin.py.txt

Installation instructions;

* Download the file.
* Save to your UserPluginFolder.
* Open the file and change the line that reads return "c:\\backups\\" so that it points at the folder you want to save backups to. Around line 19.
* Remove the .txt extension from the file.
* Start SublimeText
* Open the console with the View | Console menu item.
* When you save a file, you should see a line like this, indicating that the file has been backed up;

Automatic backup: backing up to d:\backups\C-drive\Documents and Settings\steve\Application Data\Sublime Text\Packages\User\AutomaticBackupsPlugin-2008-03-22-22-22-46.py`

0 Likes

ST3's new out of process plugins: speed/inter-process comms
Improved productivity workflow
Segfault on moving a tab
New theme forked from Soda (light/dark & alternate colors)
SublimePTY [pre-alpha]
Ctrl-V Doesn't Work?
View > Show Terminal
Build 3067: Quote pairing issue in certain syntaxes
Dev Build 3024
#2

A new version is up, and it’s now a full-blown sublime package. Also, I’ve included it in my new set of packages that are automatically downloaded by my package downloader (Package release: PackageDownloader)

This means that if you install both, you shouldn’t need to worry about upgrading, because you’ll be able to do an ‘auto-update’ to get new versions of the package.


When you edit text files (scripts, prose, whatever) you often find yourself wishing for an older version. Ever accidentally deleted a chunk from an important configuration file, or wished you could roll back a document a few hours? This plugin takes a copy of every file you save and copies it into a backup directory structure, ensuring that you never lose an old version of the file.

Once installed, any file you save will be copied into your documents folder, eg \Sublime Text Backups. For example, if you change c:\autoexec.bat, you’ll get a backup saved to:

c:\Documents and Settings\yourUserName\Sublime Text Backups\c-drive\autoexec-2008-03-22-22-22-46.bat

That end bit is the timestamp, so you can see when the file was edited.

To install it, download the package from sublimetextwiki.com/sublime- … me-package and save it to c:\program files\sublime text\Pristine Packages. Then restart Sublime Text.

If you want to back up your files somewhere other than your documents folder, you can add an option. To change where all backups are made, open the Preferences menu and choose Preferences. Then double-click Application, and add a line like this to the end of the file;

backupDir c:\my files\archive\

To see if it’s working, open the console with the View | Console menu item. When you save a file, you should see a line like this, indicating that the file has been backed up;

Automatic backup: backing up to d:\backups\C-drive\Documents and Settings\steve\Application Data\Sublime Text\Packages\User\AutomaticBackupsPlugin-2008-03-22-22-22-46.py`

0 Likes

#3

ps, if you downloaded an earlier version, please delete it from your user directory (Eg c:\documents and settings\username\Application data\sublime text\packages\user) or you’ll have two versions running at the same time.

0 Likes

#4

Hi! Feel free to update the plugin with these changes. They sound really useful. Whack them on the server and I’ll pick them up with the package downloader. Nicely done.

0 Likes

#5

I added a few features (on my local machine), would you like me to commit (some of) them?

  • When creating a backup of an existing file for the first time, it will first create a backup copy of the original
    file with a 0000-00-00-00-00-00 timestamp.

  • I added a command to show a quick panel with all the backups of the current file. WinMerge will be launched with the current file and the selected backup file.

  • Same thing but instead of launching WinMerge, the selected backup file will be shown on a 2nd pane with a 2-pane vertical layout.

  • Since that makes a lot of commands, I added a package menu.

0 Likes

#6

Good idea

You can access it here: http://bitbucket.org/gpfsmurf/automaticbackups/

0 Likes

#7

When I try to give m Merge it returns me the following message:
“You are viewing the current version of this file. Navigate to the backup version before merging.”

But I surfed a few versions back and even then the this message.
Out also that my shortcut did not work.

Someone could tell me what might be happening?
Hugs!

0 Likes

#8

Is there a way to configure this package github.com/akalongman/sublimetext-autobackups to save timestamped backup whenever I save my file instead of doing only and overwriting the last save.

I’m using ST3. With ST2 I’v been using this github.com/joelpt/sublimetext-automatic-backups , but there is no update for v3.

0 Likes

#9

Well, I was looking for the same solution…

Today, there is still no way to configure this package github.com/akalongman/sublimetext-autobackups
BUT, you can patch this file github.com/akalongman/sublimete … _helper.py
as it was shown there: Automatic Backups for Sublime Text 2 and ST3 (solution)

It is pretty dirty solution, but it does the job.

0 Likes