-
-
Save NKid/5aa212dc9ca669e700f4 to your computer and use it in GitHub Desktop.
[備份 Firefox Profile] #firefox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
ECHO ===[備份] Firefox Profile (by NKid)=== | |
TASKLIST /FI "IMAGENAME eq firefox.exe" 2>NUL | FIND /I /N "firefox.exe">NUL | |
IF "%ERRORLEVEL%"=="0" ( | |
ECHO [ERROR] Firefox is running. Please closing Firefox before backup. | |
GOTO END | |
) | |
ECHO ===[sqlite3] 壓縮資料庫=== | |
IF NOT EXIST sqlite3.exe ( | |
ECHO [ERROR] sqlite3 Not Found. | |
GOTO END | |
) | |
FOR %%i IN (D:\MySoftware\fxProfile\*.sqlite) DO sqlite3 %%i VACUUM | ECHO %%i | |
ECHO ===[7z] 產生備份檔=== | |
FOR /F "tokens=1-3 delims=/ " %%a IN ('DATE /T') DO (SET MYDATE=%%a-%%b-%%c) | |
SET NowTime=%time: =0% | |
"C:\Program Files\7-Zip\7z.exe" a -mx9 "D:\MySoftware\Firefox\Profile_%MYDATE%-%NowTime:~0,2%-%NowTime:~3,2%-%NowTime:~6,2%.7z" "D:\MySoftware\fxProfile" -xr!Cache | |
:END | |
PAUSE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment