Old 07-18-2004, 10:03 AM   #1
Mr_X
Senior Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Sep 2003
Posts: 142
Default ioBackup

It backups user files (etc, users, groups, scripts) and ioFTPD.ini into a rar file with a password and send it to another FTP or to a SMB share.

Script page

Changelog:

v1.2.1
- Didn't recursive copy, fixed now (thx to lefkas)

v1.2
- Recursive copy of dirs
- Change RARPATH to EXEPATH (there's 2 exe now: robocopy.exe and rar.exe)
- Backup now also scripts dir
- Added TODO.txt

v1.1.3
- Updated rar (3.42) and readme.txt

v1.1.2
- if env var windir doesn't exist, testing SystemRoot (same value)

v1.1.1
- Corrected some bugs and readme

v1.1
- Added the possibility to send backup to a network drive

v1.0
- initial release
Mr_X is offline   Reply With Quote
Old 07-20-2004, 05:16 AM   #2
djrob
Senior Member
FlashFXP Beta Tester
ioFTPD Registered User
 
Join Date: Jul 2003
Posts: 99
Default

Looks promising but i can't get it to work. Followed the readme but when doing "site backup" all i get is command sucessful and that's it. No backup rar-file anywhere
djrob is offline   Reply With Quote
Old 07-20-2004, 01:01 PM   #3
Mr_X
Senior Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Sep 2003
Posts: 142
Default

It's logical you get command successful, you'll get everytime this. I make the script running in background (if it's not running in background, you'll have to wait at least 3-4 seconds (time to rar and connect to the ftp and send the file) before sending another command to the FTP.
The reason because it doesn't work is that perhaps your FTP is down. I don't manage ftp errors in this version, this will be added in v2.0 (that will be totally rewritten in C).
To test it, remove "echo !detach 0" at line 5 (you will see FTP session); You will have to wait about 3-4 seconds before you see anything. Check also if the login given to the script has write permission.
Mr_X is offline   Reply With Quote
Old 07-21-2004, 06:25 AM   #4
djrob
Senior Member
FlashFXP Beta Tester
ioFTPD Registered User
 
Join Date: Jul 2003
Posts: 99
Default

Both the ftp that's being backup'd and the one it's beeing send to is ofcourse up and running. I've edited backup.bat's rarpath (which according to readme is the only thing to edit there) and added custom command in ioftpd.ini like this:

backup = EXEC ..\scripts\backup.bat testing myftp.something.com 5867 user pass folderonremoteftp

first try gave me:

R] site backup
[R] 200-Det finns redan en fil eller underkatalog med namnet backup.
[R] 200-Det finns redan en fil eller underkatalog med namnet etc.
[R] 200-Det finns redan en fil eller underkatalog med namnet users.
[R] 200-Det finns redan en fil eller underkatalog med namnet groups.
[R] 200-Det finns redan en fil eller underkatalog med namnet ini.
[R] 200-Parameters: SMB/FTP WhereToSend [Port] Login Pass Directory
[R] 200-
[R] 200-SMB/FTP Send the file via a network drive or FTP
[R] 200-WhereToSend FTP where to send backup
[R] 200-Port Port of the FTP even if it's 21.
[R] 200- Don't give it if sending via network drive
[R] 200-Login Login of the FTP
[R] 200-Pass FTP and archive password
[R] 200-Directory Where to put archive
[R] 200 Command successful.

Then i tried 2 more and both times got:
[L] site backup
[L] 500 SITE backup: Command not understood.
[L] site backup
[L] 500 SITE backup: Command not understood.

So i'm sorry to say once more... it's not working

EDIT: it is doing something though.... just found a backup folder inside my ioFTPD folder with the files that's supposed to be backup'd. What's it doing there i don't know and why it's not in rar i dunno eihter

EDIT 2: What's a SMB??
djrob is offline   Reply With Quote
Old 07-21-2004, 12:22 PM   #5
Mr_X
Senior Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Sep 2003
Posts: 142
Default

SMB means Server Message Block. It's the protocol that windows (and Samba) use to connect network drive (to a directory you shared) and transfer files

You forgot to add FTP to the line (as I see your first try)
backup = EXEC ..\scripts\backup.bat testing FTP myftp.something.com 5867 user pass folderonremoteftp

You also pointed to a bug (something I forgot: deleting old backup directory if script failed). i also found 1 error.
Everything is corrected in v1.1.1

Strange, I also got once (for me it's SITE BACKUPTO):
[L] site backupto (all parameters)
[L] 500 SITE backup: Command not understood.

I cannot explain why, I think that's an ioFTPD error.
When you got this, try reconnect to the FTP

edit: there was also some errors in readme, sorry (corrected)
Mr_X is offline   Reply With Quote
Old 07-21-2004, 01:08 PM   #6
djrob
Senior Member
FlashFXP Beta Tester
ioFTPD Registered User
 
Join Date: Jul 2003
Posts: 99
Default

I've changed the line in ioftpd.ini to:

backup = EXEC ..\scripts\backup.bat testing FTP myftp.something.com 5867 user pass folderonremoteftp

Still don't work though
Get this now:

[R] site backup
[R] 200-Det gâ€_r inte att hitta filen. <-- can't find file
[R] 200-Det gâ€_r inte att hitta s”kv„gen. <-- can't find path
[R] 200 Command successful.

I have rar.exe in scripts folder so this should be correct:
set RARPATH=..\scripts\

Perhaps it's my swedish windows it doesn't like or something..?
djrob is offline   Reply With Quote
Old 07-26-2004, 01:59 PM   #7
Mr_X
Senior Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Sep 2003
Posts: 142
Default

do not put \ at the end of RARPATH. It's the reason because script fails. It should be RARPATH=..\scripts
Mr_X is offline   Reply With Quote
Old 07-27-2004, 12:05 PM   #8
djrob
Senior Member
FlashFXP Beta Tester
ioFTPD Registered User
 
Join Date: Jul 2003
Posts: 99
Default

Nope, still the same i'm afraid

[R] site backup
[R] 200-Det g‟r inte att hitta filen. <-- can't find file
[R] 200-Det g‟r inte att hitta s”kv„gen. <-- can't find path
[R] 200 Command successful.

backup.bat:
@echo off
set RARPATH=..\scripts
set NETWORKDRIVE=B:
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 .\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
%windir%\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

ioftpd.ini:
backup = EXEC ..\scripts\backup.bat testar FTP 192.168.0.4 5678 djrob password PRIVAT
(trying local ftp now)
djrob is offline   Reply With Quote
Old 07-27-2004, 02:50 PM   #9
Mr_X
Senior Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Sep 2003
Posts: 142
Default

Do you have WINDIR env var in ioftpd.env ?
Mr_X is offline   Reply With Quote
Old 07-27-2004, 03:14 PM   #10
djrob
Senior Member
FlashFXP Beta Tester
ioFTPD Registered User
 
Join Date: Jul 2003
Posts: 99
Default

Nope. Says nothing about that in either ioftpd or iobanana downloads. Here's my .env:

SYSTEMPATH=%[$path]
VIRTUALPATH=%[$pwd]
STATSSECTION=%[$statssection]
CREDITSECTION=%[$creditsection]
SPEED=%.[speed]
USER=%[$user]
UID=%[$uid]
GID=%[$gid]
GROUP=%[$group]
GROUPS=%[group]
IDENT=%[$ident]
IP=%[$ip]
CREDITS=%[credits(mega)]
FLAGS=%[$flags]
TAGLINE=%[$unfo]
COMSPEC=%[environment(COMSPEC)]
PATH=%[environment(PATH)]
SYSTEMROOT=%[environment(SYSTEMROOT)]
SYSTEMDRIVE=%[environment(SYSTEMDRIVE)]
djrob is offline   Reply With Quote
Old 07-28-2004, 12:06 AM   #11
ChipMunk666
Senior Member
ioFTPD Foundation User
 
Join Date: Jun 2003
Posts: 220
Default

maybe you should add it and try it
ChipMunk666 is offline   Reply With Quote
Old 07-28-2004, 03:52 AM   #12
djrob
Senior Member
FlashFXP Beta Tester
ioFTPD Registered User
 
Join Date: Jul 2003
Posts: 99
Default

Quote:
Originally posted by ChipMunk
maybe you should add it and try it
Of course... if i only knew how it looks
djrob is offline   Reply With Quote
Old 07-28-2004, 01:00 PM   #13
Mr_X
Senior Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Sep 2003
Posts: 142
Default

You don't need to add it. v1.1.2 try Windir env var and if it didn't exist, it try SystemRoot
Mr_X is offline   Reply With Quote
Old 07-28-2004, 02:15 PM   #14
djrob
Senior Member
FlashFXP Beta Tester
ioFTPD Registered User
 
Join Date: Jul 2003
Posts: 99
Default

A bit closer i think.... got this 0byte file on remote ftp: testar.rar.bad
And once again i get a backup folder inside my ioftpd dir

I give up now and keep doing manual backup i think...

oh, and my ioftpd.env looks like this:

SYSTEMPATH=%[$path]
VIRTUALPATH=%[$pwd]
STATSSECTION=%[$statssection]
CREDITSECTION=%[$creditsection]
SPEED=%.[speed]
USER=%[$user]
UID=%[$uid]
GID=%[$gid]
GROUP=%[$group]
GROUPS=%[group]
IDENT=%[$ident]
IP=%[$ip]
CREDITS=%[credits(mega)]
FLAGS=%[$flags]
TAGLINE=%[$unfo]
COMSPEC=%[environment(COMSPEC)]
PATH=%[environment(PATH)]
SYSTEMROOT=%[environment(SYSTEMROOT)]
SYSTEMDRIVE=%[environment(SYSTEMDRIVE)]

Good luck with it though
djrob is offline   Reply With Quote
Old 07-30-2004, 11:45 AM   #15
zpr
Senior Member
ioFTPD Foundation User
 
Join Date: Feb 2003
Posts: 170
Default

doesnt work here neither

i dont have windir in .env but systemroot

0 byte file on destination ftp and no clue how to sent it to another drive
zpr is offline   Reply With Quote
Reply

Tags
copy, ftp, rar, recursive, send

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:57 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)