Today an accident, I wrote the diary of the big half month the encrypted file is damaged and cannot be recovered. He decided to write a dedicated backup script file.
The main idea is to create a folder under current directory backup based on today's date, and then copy the files to that folder.
The script files are as follows:
01
echo off
02
Echo ******** starts backing up log files ********
03
04
Set ymd=%date:~0,4%%date:~5,2%%date:~8,2%
05
Set backup-dir=backupnotebook-%ymd%
06
Echo Backup directory:%backup-dir%
07
08
Echo--------------------------------
09
10
If not exist%backup-dir% (
11
mkdir%backup-dir%
12
)
13
14
Copy *.NB%backup-dir%
15
16
echo ********* log backup complete!*********
17
Pause
The script will be executed automatically every time the journal is finished.
With this script, I believe that there will be no similar problems in the future!