We have all heard more than once about the need to fulfill Reserve copy data. The collapse of the system, someone's playful pens, or they, only their own, and even many reasons why your data can get corrupted or destroyed. There is no need to explain this to those who had to recover lost data for weeks.

In addition, according to the well-known law of meanness, the probability that required files will deteriorate, much higher if you do not make a backup. So let's all be saved!

Automatic backup must meet certain requirements:

  • should be performed regularly. Moreover, the copying period is determined by the frequency of data update. Those. if the files change every day, then you need to copy them every day;
  • copies must be kept separate from the data source. It can be an external drive, or even better, store copies on a remote server or in the cloud on the Internet. Then even if a room with a computer and external drive will fly up into the air, the data will remain quietly stored in the cloud on powerful and secure servers of large IT companies;
  • if the storage is small, copies should be compressed to save space;
  • for the same reason, you need to keep track of the number of last copies stored. For example, for very important data, I have 7 daily, 4 weekly and 12 monthly copies. The rest of the copies are deleted as unnecessary;
  • after saving, you need to check for backup and its integrity.

There are many programs, free and not so great, that back up your data. Let me give you an example of a free and paid program.

To do automatic start file, for example, once a week, you need

A man in a woolen cloth jacket was completely depressed by the office environment,
the smell of alizarin ink, for hours that breathed often and heavily,
and especially with a strict poster "I did my job - and go away."
Although the man in the jacket had not yet started his business, he already wanted to leave.

September 9, 2007

Recently I had a need to have backup of one database over the past few days. One of the conditions was to implement all this without using third-party or self-written programs. After some deliberation, it was decided to implement it using standard dos commands described in the bat file.

Those who know how to write BAT files may not read any further in principle. For the rest, let me explain that all lines starting with rem are comments. Therefore, they are not executed and you can copy the entire code.

And the algorithm is very simple. We have two folders archive_new, where the archive for yesterday is stored, and archive_old, where the archive for the day before yesterday is stored. Thus, we get the following:


rmdir / s / q \\ server \ archive \ archive_old

ren \\ server \ archive \ archive_new archive_old

mkdir \\ server \ archive \ archive_new
rem Copy the files with the database to the archive_new folder
copy / y * .base \\ server \ archive \ archive_new

Everything. With this algorithm, executed once a day, we will have two backups: yesterday and the day before yesterday.

This simplest algorithm is ideal when you just need to copy files to another location. It has two drawbacks.

First, the bases can be large.

Secondly, absolute paths are registered here, and when you change the settings or structure, you will have to correct all the paths in the file.

These two disadvantages are easily solved by archiving the databases and setting variables for relative paths.


rem The current date will be used instead of the archive name
SET archive_name =% date% .rar

rem Delete the archive_old folder

rem Rename the archive_new folder to archive_old

rem Create directory archive_new

rem Archive all files except * .exe and * .bat
rar a -r -m5 -x * .bat -x * .exe% archive_name%
rem Copy the archive with the database to the archive_new folder
copy / y% archive_name%% server_dir% \ archive_new \
rem Move archive
move% archive_name%% serev_dir% \ archive_new \

NB: for the line with archiving to work, you need the file "rar.exe" from the standard WinRar distribution "a.

The above example has one major drawback: if the database is constantly used by the application, then the archiver will not be able to access it. In this case, you will have to slightly correct the design and first copy the files to another directory, where they are archived.

rem We declare variables for the name of the archive and the path of the archive folder on the server
SET archive_name =% date% .rar
SET server_dir = \\ server \ archive \
SET temp_dir = \\ temp \
rem Delete the archive_old folder
rmdir / s / q% server_dir% \ archive_old
rem Rename the archive_new folder to archive_old
ren% server_dir% \ archive_new archive_old
rem Create directory archive_new
mkdir% server_dir% \ archive_new
rem Copy the files with the database to the temp folder
copy / y * .base% temp_dir%
rem Archive all files in the temp folder, except * .exe and * .bat
rar a -r -m5 -ep1 -x * .bat -x * .exe% archive_name%% temp_dir%
rem Move the archive to the archive_new folder
move% archive_name%% server_dir% \ archive_new \
rem Clear the contents of the temp folder
del / q% temp_dir% *. *

In general, that's all. Now all that remains is to make a schedule for the execution of this .bat file and you do not have to worry about the safety of the site database.

P.S. For those who want to pervert, most of the things described here can be done through keys in RAR "e.

There are a lot of programs for creating backup copies (backup, backup). There are paid ones, and there are free ones. Some use "wizards" that allow you to specify a ton of options without having to go through a complex configuration process.

However, the backup process itself is actually a simple copy. There are, of course, options, like: archiving, tracking changes, etc., but for most cases the algorithm itself comes down to simple actions:

  • selection of source data (directory, files);
  • choice of where to copy (directory);
  • directly copying.
So, in order to perform all these operations, it is not at all necessary to resort to help third-party programs... Everything you need is already in Windows.

In order to copy a file / directory, use the command xcopy... It has many parameters, but in general it is indicated like this:

Xcopy "D: \ myfiles \ *. *" "J: \ backup \ myfiles \ *. *"

This command will copy the directory “ d: \ myfiles" in " j: \ backup \ myfiles».

So our actions are very simple. First, let's open Notepad2. In it you need to specify the directories that should be backed up. Personally, my important data is stored in several directories: "txt", "work", etc.

With the second parameter, we indicate where to copy. I usually use external for redundancy. HDD(USB).

In order for Windows to assign the same drive letter each time it is connected, you need to enter Control Panel - Administrative Tools - Computer Management - Disk Management... On the connected drive, right-click and select " Change drive letter or drive path ...". In the window that opens, select " Edit»And enter the letter you want. For example, I have "J"

For convenience, it's best to keep directory names so you don't get confused later. And I place the backup in a separate directory “ backup».

The copying algorithm will be as follows: we will copy only new files, the old ones will be overwritten. At the same time, we will not delete files that no longer exist in the source directory. All this is achieved by specifying parameters for xcopy.

Here is a working example of a wallet reservation WEBMONEY and Yandex money:

Xcopy "C: \ Program Files \ WEBMONEY \ *. *" "J: \ backup \ WEBMONEY *. *" / E / F / H / R / K / Y / D xcopy "C: \ Program Files \ Wallet \ * . * "" j: \ backup \ Wallet *. * "/ E / F / H / R / K / Y / D

These lines need to be copied to Notepad2 and save in a file with the extension ".bat", for example " backup.bat". Now we just need to run it and everything will be done automatically.

Now pay attention that we indicate the paths in quotes "" "- this is Windows requirement for long names. The directories are separated by a backslash "". At the end, the parameters for xcopy.

That is, you only need to specify your directories for backup and save as " backup.bat". You can make several such files: the copying process can sometimes take a long time, so I copy some very critical data more often - there is another file for them " QiuсkBACKUP.BAT».

Naturally, you need to make sure that there is enough space on the destination disk.

Now the next thing you may encounter is the incorrect encoding of the text. The fact is that Russian letters for DOS (where copying takes place) differ from Windows (where you created a bat-file). For example, I have a directory “ c: \ Favorites". If I run the bat file, nothing happens because xcopy it just won't find it. Therefore, our bat file needs to be converted to DOS encoding (it is often called “ OEM»).

To do this, we highlight such lines in Notepad2 and click Ctrl + Shift + O(or Edit - Convert - To OEM Text). You will see "rubbish", but do not be alarmed, it should be so. In my example, it looks like this: “ c:? §Ўа ®Ґ»

if you have Total commander then you can view this file by F3 and switch the encoding in the viewer - the key " S».

The next task, which I do not use, but may be useful to you, is copying current version directory, and the old backup is renamed to " old».

Here the task is quite simple: first you need to delete the old " old", Then rename the current backup to" old"And copy as usual xcopy... Here is an example of a directory reservation “ c: \ work»:

Del "j: \ backup \ work_old" / s / q rmdir "j: \ backup \ work_old" / s / q rename "j: \ backup \ work" "work_old" xcopy "c: \ work \ *. *" " j: \ backup \ work *. * "/ E / F / H / R / K / Y / D

Team " del»Removes all files from the directory. Team " rmdir"Removes an empty directory. Team " rename»Renames files. And the command “ xcopy»We copy the files as usual.

If you use a mail client to work with mailThe Bat! , then, probably, met with the automatic backup function. Program on a specific day and certain time(which are set in the settings) starts to create an archive with data at the most inopportune moment.

I see nothing wrong with this process. But if you have a computer with minimal performance (which is most likely the case, since programs of this type are most often used in offices), then at the most inopportune moment for this, The Bat! launches its clumsy operation, which "freezes" the computer.

Cancel the archiving operation in this moment it is not easy, it just freezes. Even to close it, you need to call the device manager (keyboard shortcut Ctrl + Alt + Delete).

Therefore, it is better to change the time at which the archive will be created or turn it off altogether. In the latter case, archiving will have to be started manually.

To go to the settings, open. There we find the item "System"і uncheck the box opposite “Copier. Every ".

If necessary, configure the backup, in particular, specify the location for saving the archive, configure what needs to be archived and other parameters, you need to go to "Properties → Settings → System" and press the button "Additionally"... There in the tab "General" select the directory in which the backups will be saved, and also mark what to copy (properties mailbox, mail folders, address books, user settings, files attached to letters).

Below in the same window, select the mailboxes that will be processed (if you have several of them), as well as address books.

Tab "Additional" allows you to set a password for the archive. This way you can be sure that no one but you will be able to use the personal letters and information contained in the archive.

Tab "Folders" allows you to specify folders for processing. All are selected by default.

Those who are not yet familiar with The Bat! Mail client can do it using the link below.

The Bat!—Program number 1 for working with by e-mail... This program has many victories in various tests. This mail client supports all possible protocols and encryption methods. The client is easy (for most popular mail services, almost automatically, you only need a login and password) is configured and requires a small amount of system resources and, in my experience, it displays the contents of letters better and correctly synchronizes with the server. Works with IMAP4, POP3, APOP, SMTP, SMTP authentification protocols.

We continue to study The Bat! In this tutorial, we'll walk through the backup and restore of mailboxes along with all the settings, search capabilities, and (hot key).

Backup

In previous lessons, we studied But when you reinstall the system or run the program on another computer or laptop, it becomes necessary to re-configure sending and receiving mail for each mailbox, automatic sorting, letter templates, etc. The task is especially complicated when there are a lot of mailboxes and they are registered with different mail services. Is solved this problem backup, thanks to which you can not only restore all the settings of e-mail boxes, but also all incoming and outgoing letters in these boxes.

Let's take a look at the procedure for creating and restoring a backup copy of The Bat! using screenshots. The picture below shows where the corresponding menu items are located.

To create a backup copy, select the menu item of the same name and in the next window set the path and name of the future archive by clicking on "Browse". If necessary, write a comment to the archive.

IMPORTANT! When specifying a location for creating an archive, select a disk other than the system one, since the archive may be overwritten when reinstalling the system. For example, if the system is located on disk "C", then specify the location for the archive on "D", "E" or on a flash drive.

After clicking "OK" a window will appear in which you can select all or individual boxes for archiving. Also, if necessary, you can set a password for the archive.

After pressing “OK” again, The Bat!

To restore from a backup, select the appropriate menu item (see the first screenshot). Then click "Add" and find the archive created earlier. Then click "OK". In the next window, select the mailboxes for recovery and click "OK" again. We are waiting for some time and enjoy the result

By the way, if you use the portable version of The Bat !, located not on the system drive, then after reinstalling the system, the mail client will not need to be restored at all - it will be immediately ready to work. You just need to re-create the shortcut executable file on your desktop.

Search in The Bat!

The Bat! Mail client has a powerful search that uses fine-tuning of the parameters of the required information. If you have a dozen mailboxes and hundreds or even thousands of letters in them, then this tool is simply irreplaceable.

Here are the search criteria you can customize:

1. Calling the search window
2. Search terms. You can select the following parameters:

  • text
  • sender (e-mail)
  • recipient (e-mail)
  • heading
  • note
  • Attached files
  • any part

3. Remove condition
4. Add a new condition
5. Selection of the parameter "AND", "OR"
"And" - all specified conditions must be met
"OR" - at least one of the specified conditions must be met
6. Select boxes and folders for search
7. Start search
8. Advanced search - makes it possible to set search parameters even more precisely. For example: letter size, letter attribute (status), limitation period, time interval and other criteria. I will not consider this mode. Everything is intuitive there, I think you can figure it out.

Let's look at two search examples:

Example 1. Let's say we need to find all letters with the phrase in the subject line "Windows 7 lesson" or "Windows 7 lesson" (we don't remember exactly). We will search in all mailboxes. The search setup will look like this:

Example 2. It is necessary to find a letter from the author (sender) D. Pecherkin, which contains the phrase "how to make money in affiliate programs" in the text, but does not contain the word "mailing". It is also known that the letter is in the Yandex mailbox. The settings will be as follows:

The Bat! Hotkeys

The Bat! has a set for a quick call of a particular function. The most commonly used combinations are:

  • create a letter - Ctrl + N
  • get new mail - F2
  • get mail for all mailboxes at once - Alt + F2
  • send mail - Shift + F2
  • mailbox properties - Alt + Enter
  • quick reply to a letter - Ctrl + Enter
  • template call - Ctrl + space
  • creating a sorting rule - Shift + Ctrl + F
  • search - F7
  • address book - F8

See all hotkeys of The Bat! can be found in the program menu opposite the corresponding commands.

The program also has the ability to set your own hotkey combinations through the menu "Properties" / "Settings" / section "Other options" / "System keys".

That's all I wanted to tell you about The Bat! I hope the information in this lesson will be useful to you and will help you to work more productively with this wonderful program!