Thread: ioBackup
View Single Post
Old 08-23-2004, 04:43 AM  
F30R
Junior Member
 
Join Date: Jan 2004
Posts: 11
Default

[11:41:19] site backup
[11:41:21] 200-The system cannot find the file specified.
[11:41:21] 200-Invalid command.
[11:41:21] 200-Invalid command.
[11:41:21] 200-Not connected.
[11:41:21] 200-Not connected.
[11:41:21] 200-Not connected.
[11:41:21] 200-open xxx 21
[11:41:21] 200-backup
[11:41:21] 200-backup
[11:41:21] 200-cd c:\
[11:41:21] 200-del test.rar
[11:41:21] 200-put test.rar
[11:41:21] 200-bye
[11:41:21] 200-> ftp: socket :Unknown error number
[11:41:21] 200 Command successful.


my bat is :

@echo off
set RARPATH=c:\server\scripts
set NETWORKDRIVE=X:
if not exist %RARPATH%\rar.exe goto rarnotexist
if %2==FTP goto FTPT
if %2==ftp goto FTPT
if %6.==. goto usage
goto paramok
:FTPT
if %7.==. goto usage
aramok
REM Make the script running in background. Delete previous line
REM if you want to see FTP session or network drive copying
:updir
cd ..
if not exist c:\server\system\ioFTPD.exe goto updir
rd /s /q backup
md backup\etc
cd backup
md users
md groups
md ini
copy ..\etc\*.* .\etc >nul
copy ..\users\*.* .\users >nul
copy ..\groups\*.* .\groups >nul
copy ..\system\*.ini .\ini >nul
%RARPATH%\rar.exe a -s -inul -hp%6 %1.rar etc
%RARPATH%\rar.exe a -s -inul -hp%6 %1.rar users
%RARPATH%\rar.exe a -s -inul -hp%6 %1.rar groups
%RARPATH%\rar.exe a -s -inul -hp%6 %1.rar ini
if %2==SMB goto NetDrive
if %2==smb goto NetDrive
if %2==FTP goto ViaFTP
if %2==ftp goto ViaFTP
goto usage
:ViaFTP
echo open %3 %4>script.txt
echo %5 >>script.txt
echo %6 >>script.txt
echo cd %7 >> script.txt
echo del %1.rar >>script.txt
echo put %1.rar >>script.txt
echo bye >>script.txt
c:\winnt\system32\ftp.exe -s:script.txt
goto end
:NetDrive
net use %NETWORKDRIVE% %3 %6 /user:%5
net use %NETWORKDRIVE% %3 "" /user:%5
copy %1.rar %NETWORKDRIVE%
net use %NETWORKDRIVE% /delete /yes
goto end
:usage
if %1.==. goto notfirst
echo Parameters: SMB/FTP WhereToSend [Port] Login Pass Directory
echo.
goto cont
:notfirst
echo Usage: %0 FTPName SMB/FTP WhereToSend Port Login Pass Directory
echo.
echo FTPName Archive will have this name (pay attention, old one will be deleted)
:cont
echo SMB/FTP Send the file via a network drive (SMB) or FTP
echo WhereToSend Address where to send backup
echo if using SMB use \\adresse\share
echo Port Port of the FTP even if it's 21.
echo Don't give it if sending via network drive
echo Login Login of the FTP
echo Pass FTP and archive password
echo Directory Where to put archive (do not put any '/' or '\' at the begining)
goto end
:rarnotexist
echo Edit this script's second line and set RARPATH (directory where is rar.exe)
:end
cd..
if exist .\system\ioFTPD.exe rd /s /q backup
F30R is offline   Reply With Quote