Please add automatic file saving to the directory
-
Hello! I work with files from an external storage device. Notepad++ does not have the function of automatically saving a file at specified time intervals to a specified directory. It is necessary to save the current version of the file on my work computer. Automatic file saving should be triggered when the external drive is unmounted or when the file is manually saved. Please add this feature to Settings -> Preferences -> Backup. The existing backup function deletes the backup files during manual saving. And the backup (when saved) saves only the previous state of the file. The latest version of the file remains only on my drive. Thanks !
-
saving a file at specified time intervals
The AutoSave plugin adds the timed-saving aspect of your request to Notepad++
The Notepad++ author doesn’t usually duplicate a feature that a plugin already provides, unless he thinks it insufficient for desired behavior. In this case, the plugin gives you exactly what you want, so he will not duplicate the plugin in the main app.
As such, just go to Plugins > Plugins Admin, and install the AutoSave plugin.
We have a FAQ which explains the built-in vs AutoSave plugin features, and how to properly configure the plugin.
Automatic file saving should be triggered when the external drive is unmounted
Detecting mounting/unmounting doesn’t seem an easy task. And how can you auto-save to a directory after it’s been unmounted?
or when the file is manually saved
… hmm, with this, I wonder if you’re actually asking for it to save somewhere else, along with the normal file location. For that, you can use Notepad++'s built-in backup on save option (also described in the same FAQ), defining your custom single directory that holds all backups.
So, to get 2/3 of your request, you would install the AutoSave plugin for timed saving of the main file, along with the builtin backup-on-save to a specified directory.
-
-
The AutoSave plugin does not allow you to select files to save by filter.
-
The AutoSave plugin saves the current file to itself. The plugin does not allow you to specify a directory and create a copy of the file.
-
The existing backup function deletes the backup files after you have manually saved the file.
-
The external drive is unmounted by the user in the Windows tray. It’s easy to track. It’s just about turning off the drive cold, of course.
-
It is necessary to save a copy of the file to the specified directory:
- at specified time intervals
- when saving the file manually
- when the user performs software unmounting of an external drive
-
-
Tell me how to change the name of my topic to English. “Пожалуйста, добавьте автоматическое сохранение в директорию” change to
“Please add automatic file saving to the directory” -
- The AutoSave plugin does not allow you to select files to save by filter.
You said nothing about “filter” in your original description.
- The AutoSave plugin saves the current file to itself. The plugin does not allow you to specify a directory and create a copy of the file.
I didn’t say that it did. I said it was able to save on a timer. You have to combine it with Notepad++'s backup-on-save feature to be able to create a copy of the file at the same time. See below for more
- The existing backup function deletes the backup files after you have manually saved the file.
You are incorrectly believing that Notepad++'s “periodic backup” function and “backup on save” function do the same thing. They do not. “periodic backup” will save a snapshot of unsaved files to the
%AppData%\Notepad++\backup\dirtectory, and delete the temporary snapshot file once you save to disk. “Backup on save”, on the other hand, will save two copies of the file whenever a save is triggered – it will write the main file, and it will write to the defined backup location:- if your file is called
c:\path\file.txt, the possible backup-on-save locations are☑ None⇒ will not do backup-on-save☑ Simple⇒ will save a backup of the file toc:\path\file.txt.bakif you don’t have custom directory defined, or toc:\custom\file.txt.bakif you do☑ Verbose⇒ will save a backup of the file toc:\path\nppBackup\file.txt.yyyy-mm-dd.bakif you don’t have custom directory defined, or toc:\custom\file.txt.yyyy-mm-dd.bakif you do
This was described in the FAQ, plus the extra details in the User Manual, where the FAQ linked – specifically, in the section called “Built-in Backup On Save” (there’s a reason I used that phrase in my post above).
Please notice, I said every time a save is triggered. Since AutoSave plugin can trigger a save on a timed schedule, that means that when AutoSave makes Notepad++ save unsaved changes to
c:\path\file.txt.bak, then Notepad++'s backup-on-save feature will be triggered, and it will also save a copy to the appropriate simple or verbose filename and directory.Thus, to get the situation I described:
- Install AutoSave plugin. Set it to save every N minutes.
- In Notepad++'s Settings > Preferences > Backup, choose
☑ Simpleand set☑ Custom Backup Directorytoc:\custom\or wherever your desired single folder backup location is.
⇒ Then, with that setup: every N minutes, if there are any changes to the file, AutoSave plugin will save the file to
c:\path\file.txt. Notepad++ will see that the file is being saved, and also save acopy toc:\custom\file.txt.bakAgain, to repeat myself and be absolutely clear, this setup will save two copies of the file every time you hit save, and it will save two copies of the file every time AutoSave plugin timer triggers (so every N minutes, assuming there are unsaved changes).
- The external drive is unmounted by the user in the Windows tray. It’s easy to track. It’s just about turning off the drive cold, of course.
You assume that Windows will bother telling an application that it has unmounted (and even less likely, that it has mounted). And polling every possible mounted drive to manually look for mounts or unmounts (when a mounted drive could either be one of about 23 drive letters or so, or an effectively-uncountable number of
\\machine\mountpointdrives), watching for both mounting and unmounting is not a practical task.- It is necessary to save a copy of the file to the specified directory:
- at specified time intervals
- when saving the file manually
- when the user performs software unmounting of an external drive
The first two-thirds of those are done by the situation I describe. The third is more difficult than you believe, and is likely not practical and even less likely to be implemented.
-
Tell me how to change the name of my topic to English.
If you’re still within the edit window for your post (4 hours), you can edit the original post, and it will let you change the topic name in the post header. But a moderator has already changed it for you, so you don’t need to do so this time.
-
The more I read your problem, the more I think you need a different solution:
- Just edit the file locally in Notepad++, without trying to get Notepad++ to write two copies
- Use some external program (like an always-on rsync setup) that will sync from your local location to the network location (either on a frequent schedule, or every time it sees a change in the local file). If the network location doesn’t exist temporarily, the rsync won’t be able to do it; but the next time the rsync is triggered and the drive is there, it will the changed files to the network.
-
I said,
will save two copies of the file whenever a save is triggered – it will write the main file, and it will write to the defined backup location:
So, that’s technically true, but I had forgotten a small caveat, that came as I was verifying my assertions in a portable Notepad++ with AutoSave turned on to save every 1 minute:
What happens is that when a save is triggered (either from the save button, File > Save, or the AutoSave plugin), Notepad++ copies the current contents of the file on disk to the backup location, then saves the new edits to the original location – so the backup is always one version out of date w/r/t the main file. If that’s really what you want, then my description still holds – it solves 2/3 of the problem.
If that’s not right, and you really want two identical copies of the file saved, it would have to be a custom solution, because saving two identical copies in two locations, every time a file is saved is not a normal feature of a text editor. However, that could, theoretically be implemented by making a custom plugin, or (easier) through hooking into either the FILEBEFORESAVE or FILESAVED event using one of the N++ scripting plugins, like PythonScript or LuaScript.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login