tinboye Posted May 12, 2016 Share Posted May 12, 2016 So i been trying to get this backup script to to work. But for some reason i keep getting errors. Here is the script: @ECHO off SETLOCAL SET PATH=%PATH%;C:\Program Files\7-Zip\ SET BACKPATH=%ThisService_RootDirectory%MPMissions SET DEST_PATH=%ThisService_RootDirectory%Backups REM Replace space in hour with zero if it?s less than 10 SET hr=%time:~0,2% IF %hr% lss 10 SET hr=0%hr:~1,1% REM This sets the date like this: mm-dd-yr-hrminsecs1/100secs Set TODAY=%date:~4,2%-%date:~7,2%-%date:~10,4%-%hr%%time:~3,2%%time:~6,2%%time:~9,2% ECHO. ECHO Zipping all date files in MpMissions and archiving to Backups Folder ECHO. 7z a -r -tzip ?%DEST_PATH%\%TODAY%.zip? ?%BACKPATH%\*? -mx5 :END ENDLOCAL and here is the error: Zipping all date files in MpMissions and archiving to Backups Folder 7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31 Scanning the drive: WARNING: The filename, directory name, or volume label syntax is incorrect. ?C: 0 files, 0 bytes Creating archive: ?C:\TCAFiles\users\admin\5\Backups\05-12-2016-03362406.zip? Items to compress: 0 Scan WARNINGS for files and folders: ?C: : The filename, directory name, or volume label syntax is incorrect. ---------------- Scan WARNINGS: 1 Error: cannot open file ?C:\TCAFiles\users\admin\5\Backups\05-12-2016-03362406.zip? The filename, directory name, or volume label syntax is incorrect. System ERROR: The filename, directory name, or volume label syntax is incorrect. anyone know what the issue is, or have an alternative script to have the user click an icon in their members area and can backup certain folders. Link to comment Share on other sites More sharing options...
Dennis Posted May 13, 2016 Share Posted May 13, 2016 SET PATH=%PATH%;C:\Program Files\7-Zip\ Why that part? %PATH% is a system variable that outputs something like this if echoed: C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\android-adb\platform-tools;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\OpenVPN\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Users\Dennis\AppData\Local\atom\bin;C:\Users\Dennis\AppData\Roaming\npm C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\android-adb\platform-tools;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\OpenVPN\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Users\Dennis\AppData\Local\atom\bin;C:\Users\Dennis\AppData\Roaming\npm Link to comment Share on other sites More sharing options...
tinboye Posted May 13, 2016 Author Share Posted May 13, 2016 If that is not specified then 7z will not work unless I place the exe in the same folder of the script. Link to comment Share on other sites More sharing options...
Dennis Posted May 14, 2016 Share Posted May 14, 2016 If you try to put 'ECHO' in front of 'SET PATH=%PATH%;C:\Program Files\7-Zip\', what's the output then? Link to comment Share on other sites More sharing options...
numpty Posted December 31, 2017 Share Posted December 31, 2017 I have a backup script for Arma. Or any game server really. It works like a charm and is fully customzable Link to comment Share on other sites More sharing options...
ECF Posted December 31, 2017 Share Posted December 31, 2017 http://help.tcadmin.com/Backup_%26_Restore_Scripts Luis just posted this yesterday. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now