Sublime Forum

Backup files

#1

Hi,

I am totally new to Sublime Text 2 as of a couple of days ago, and am gradually getting to grips with the huge amount of functionality available. I am impressed! :smile: However, one thing I was hoping to be able to do concerns backup files. When I edit a file, it automatically creates a .bak file in my project folder. This means that when I do a, for example, ā€˜Find in Files’ search, it includes all the backup files in the results, which is kinda annoying. Is there any way I can direct the .bak files to a subdirectory called, for example, ā€˜backup’?

I have installed the package ā€˜Automatic Backups’. I am working in directory

C:\Data\LxAC\V12_3_0_Os_2_5_2

and have set the directory I want backups to go to to ā€œ.\backupā€ but the console gives me the following message when I write a file that I have edited:

ā€˜Backup saved to: .\backup\C\Data\LxAC\V12_3_0_Os_2_5_2\NODE-2015-08-04_16-21-16.CPP’

where I really want it to be saved to

ā€˜C:\Data\LxAC\V12_3_0_Os_2_5_2\backup\NODE-2015-08-04_16-21-16.CPP’

I apologise in advance if this posting is in the wrong forum, or is answered elsewhere or is even so basic that I should have been able to sort it out myself. Please be kind to a newbie! :wink:

0 Likes

#2

The package you mentioned, Automatic Backups, stores all backups under the same common directory and then reflects the actual file’s path inside that directory. This is not configurable, as far as I can see.

packagecontrol.io/packages/Crea … kup%20Copy, another package, creates backups in a .sublime-backups\ directory relative to the source file and should be what you want. It doesn’t run automatically on-save or on-open however; you have to trigger it manually.

As a suggestion for a different workflow, you should take a look at a VCS (version control system) and git in particular.

0 Likes

#3

Many thanks, FichteFoll, that sounds exactly what I’m after.

Regards, Ali

0 Likes