Jump to content

Backup Script


tinboye

Recommended Posts

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

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

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 94 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use