Shocks Posted October 27, 2010 Share Posted October 27, 2010 I edited my last comment with kind of an expansion for my question if you didn't see it. Link to comment Share on other sites More sharing options...
Dateranoth Posted October 27, 2010 Author Share Posted October 27, 2010 If you're just uploading to the root then yes. You're remote directory should just be a forward slash /::Set your REMOTE ftp directory for Overviewer. Should be base directory containing index.html. (Full Remote Path)SET ftpovwrdirectory=/ Link to comment Share on other sites More sharing options...
Shocks Posted October 27, 2010 Share Posted October 27, 2010 Alright, thanks. Sorry about having so many (what ended up being) simple questions. I do QA for software for a living too, you'd think I would be able to figure this stuff out. Link to comment Share on other sites More sharing options...
Dateranoth Posted October 27, 2010 Author Share Posted October 27, 2010 It's not a problem at all. I'm happy to help. User input is what keeps me tweaking this program. Keep me up to date on any questions or suggestions you may have. Link to comment Share on other sites More sharing options...
Shocks Posted October 27, 2010 Share Posted October 27, 2010 It's not a problem at all. I'm happy to help. User input is what keeps me tweaking this program. Keep me up to date on any questions or suggestions you may have.Also it seemed like part of my problem is on:::Would you like to use Overviewer to map your backups? First run can take a LONG time. (yes or no)SET UseOVWR=yesI had it set to "Yes" instead of "yes" Link to comment Share on other sites More sharing options...
Dateranoth Posted October 27, 2010 Author Share Posted October 27, 2010 I need to make a note that the variables are case sensitive. Either that or change them all to 1 or 0 OR change the variable checks to case insensitive. Not sure what the best route is. Link to comment Share on other sites More sharing options...
Shocks Posted October 27, 2010 Share Posted October 27, 2010 My only issue now is that it doesn't seem to be automatically uploading to the site. I wasn't around when the Overviewer finished so I don't know if it said anything, but it ran for about 9-10 hours and the Utility was running its backups like normal, and my map.zjnewbs.com was still my old map. Link to comment Share on other sites More sharing options...
Dateranoth Posted October 27, 2010 Author Share Posted October 27, 2010 Can you post your user varibles again? Also, can you run the debug I linked? Will help me diagnose if its the batch or an ftp problem. Link to comment Share on other sites More sharing options...
Shocks Posted October 27, 2010 Share Posted October 27, 2010 ::-----------------------------------------------------------------------------------::::----------------User Variables - Change these to fit your situation----------------::::-----------------------------------------------------------------------------------:: ::Set to use Incremental Backup. Only supports 7zip compression method. (yes or no)::Incremental will create one base file and then only the changed updates from that point forward in 7-zip format.::In order to restore the world you MUST extract the base file and then the changes in order until the date/time you wish to restore is reached.SET UseIncr=yes ::Set to the number of Incremental Backups you would like created before a new folder and master file is created.::If you multiply this number by your backup Time you will get the amount of time between new incremental folder creation.::ie. Backup time of 10 minutes, and an Incremental Backup # of 6 would create a new master and folder every 60 minutes.SET IncrCounterMax=336 ::Set Server Directory (The folder your "World" folder lives in...NOT the path inside your world folder)SET WorldDIR=C:\Users\Administrator\MineCraft ::Set World Name (Copy your World Folder name here)SET WorldNAM=World1 ::Set Backup Directory (Where do you want to save your backups?)SET BackupDIR=E:\Overviewer\Backup ::Set Time between Backups (in minutes)SET Timer=30 ::Set Compression Method (rar or 7zip)SET Method=7zip ::Set Directory for 7z.exeSET _7zipdir=C:\Program Files\7-Zip ::Set the format you would like the date to appear on backup files. Default is year(%%g)-month(%%e)-day(%%f). Your windows time format may differ.:: If it does or you would like something different then rearrange the parameters below until satisfied. Results will be format1-format2-format3set dateformat1=%%gset dateformat2=%%eset dateformat3=%%f ::Would you like to use the VBS file to force a save-all to your server? yes or noSET UseVBS=yes ::Set directory where saveall.vbs is locatedSET VBSDir=C:\Users\Administrator\MineCraft ::Will you be using Sleep.exe? (yes or no)SET UseSleep=no ::Set Sleep EXE directory if using Sleep.exeSET SleepExe=C:\windows\system32 ::Would you like to use Cartographer to map your backups? yes or noSET UseCart=no ::Set directory where Cartograph.exe is locatedSET CartDIR=C:\Minecraft_Server\Cartographer ::Set Cartograph map type. Refer to Cartograph Readme.txt for more info or leave at default setting.SET CartMap=normal 0 0 0 0 ::Set how often you would like Cartograph to be ran. (in minutes) Minimum is the time between backups.::Will only be ran when a backup runs. ie. If your backup time is every 30 minutes, then Cartograph::can be set to run every 30 minutes, 1 hour, 1 hour and 30 minutes, 2 hours, etc. ::Odd times will round forward, running after the time has been met but not until the backup starts.::Time can be different from Overviewer Time.SET CartTimer=240 ::Set to 0 if you DON'T want Cartograph to run when the batch file is initially opened.SET CartFirstRun=0 ::Would you like to use Overviewer to map your backups? First run can take a LONG time. (yes or no)SET UseOVWR=yes ::Which method of Overviewer? Windows Executable or Python Script? (exe or python)SET OVWRmethod=exe ::Set directory where Overviewer is locatedSET OVWRDIR=E:\Overviewer ::Set Overviewer Image Directory (Overviewer Output)SET OVWROUTDIR=E:\Current Map ::Set Overviewer CACHE Directory (Where Overviewer Cache files are stored)SET OVWRCACHEDIR=E:\Map Cache ::How many processors should Overviewer Use? (This should be set low or it will cause lag on the server)SET Procs=1 ::Set how often you would like Overviewer to be ran. (in minutes) Minimum is the time between backups.::Will only be ran when a backup runs. ie. If your backup time is every 30 minutes, then Overviewer::can be set to run every 30 minutes, 1 hour, 1 hour and 30 minutes, 2 hours, etc. ::Odd times will round forward, running after the time has been met but not until the backup starts.::Time can be different from Cartograph Time.SET OVWRTimer=360 ::Set to 0 if you DON'T want Overviwer to run when the batch file is initially opened.SET OVWRFirstRun=1 ::Would you like to use WinSCP FTP to upload the Overviewer map to a web server? (yes or no)::If connecting to a secure ftp the first run will ask you to save the key to cache.::Once saved it will run automatically without user input from that point on. SET useftp=yes ::WinSCP is required. Please set the path to WinSCPSET ftpwinscpdir=E:\WinSCP ::Set your ftp address here WITHOUT ftp:// (site:port)SET ftpurlport=ftp.zjnewbs.com:21 ::Set the login name for your FTP.SET ftploginname=Blah blah ::Set the password for your FTP.SET ftploginpass=Blah blah ::Set the max upload bandwidth you want WinSCP to use (kibps)SET ftpspeed=1000 ::Set your REMOTE ftp directory for Overviewer. Should be base directory containing index.html. (Full Remote Path)SET ftpovwrdirectory=/C:\Users\Administrator\Desktop\Backup Utility>setlocal C:\Users\Administrator\Desktop\Backup Utility>set LogPath= C:\Users\Administrator\Desktop\Backup Utility>set LogFileExt=.log C:\Users\Administrator\Desktop\Backup Utility>set LogFileName=MCBackupDebug.log C:\Users\Administrator\Desktop\Backup Utility>set dateformat1=%g C:\Users\Administrator\Desktop\Backup Utility>set dateformat2=%e C:\Users\Administrator\Desktop\Backup Utility>set dateformat3=%f C:\Users\Administrator\Desktop\Backup Utility>for /F "tokens=1-5 delims=/\ " %din ("Wed 10/27/2010") do SET Date1=%g-%e-%f C:\Users\Administrator\Desktop\Backup Utility>SET Date1=2010-10-27 C:\Users\Administrator\Desktop\Backup Utility>for /F "tokens=1-5 delims=: " %d in ("16:22:03.29") do SET Time1=%d%e C:\Users\Administrator\Desktop\Backup Utility>SET Time1=1622 C:\Users\Administrator\Desktop\Backup Utility>set MyLogFile=2010-10-27--1622 C:\Users\Administrator\Desktop\Backup Utility>set MyLogFile=2010-10-27--1622_MCBackupDebug.log C:\Users\Administrator\Desktop\Backup Utility>If NOT Exist "2010-10-27--1622_MCBackupDebug.log" goto:noseparator C:\Users\Administrator\Desktop\Backup Utility>echo.Wed 10/27/2010 1>>"2010-10-27--1622_MCBackupDebug.log" C:\Users\Administrator\Desktop\Backup Utility>echo.16:22:03.30 1>>"2010-10-27--1622_MCBackupDebug.log" C:\Users\Administrator\Desktop\Backup Utility>MCBackup.bat 1>>"2010-10-27--1622_MCBackupDebug.log" Link to comment Share on other sites More sharing options...
Dateranoth Posted October 27, 2010 Author Share Posted October 27, 2010 Ok, I found your problem. The latest update should fix it. It was a protocol issue. I have been meaning to add the option to change ftp protocols and now you can. You shouldn't have any issues with the latest version. If you don't want to redownload you need to add this below line 205:::Set your ftp Protocol (ftp or sftp or scp)SET ftpprotocol=ftpand change line 490 fromstart winscp.exe /console /command "open %ftploginname%:%ftploginpass%@%ftpurlport%" "synchronize remote -delete -criteria=both -speed=%ftpspeed% ""%OVWROUTDIR%"" ""%ftpovwrdirectory%""" "exit"tostart winscp.exe /console /command "open %ftpprotocol%://%ftploginname%:%ftploginpass%@%ftpurlport%" "synchronize remote -delete -criteria=both -speed=%ftpspeed% ""%OVWROUTDIR%"" ""%ftpovwrdirectory%""" "exit" Link to comment Share on other sites More sharing options...
Dateranoth Posted October 27, 2010 Author Share Posted October 27, 2010 ::V2.2-Added option to change ftp protocol when uploading Overviewer map----------------::::-----Also, note that yes/no variables are case sensitive. They need to be lowercase---:: Link to comment Share on other sites More sharing options...
Shocks Posted October 28, 2010 Share Posted October 28, 2010 Any idea how I might go about running Win SCP in passive mode while still being automated. For some reason I have an issue connecting and keeping a connection when I try to run the upload. It keeps timing out, and passive mode is the only way I (by I, I mean my friend who originally help me set this server up) could get it to stay connected long enough to upload.Meh, I just tried changing it to:::Attempts to kill WinSCP in case it was still running or stuck from last time.::Starting the FTP Upload Process. It is opened as a seperate process and is not waited for because it can take a long time.:startftpECHO Starting FTP Upload. Process will open in a new window and backup batch will continue to run without waiting.taskkill /im winscp.execd /d "%ftpwinscpdir%"start winscp.exe[b] /console /passive /command[/b] "open %ftploginname%:%ftploginpass%@%ftpurlport%" "synchronize remote -delete -criteria=both -speed=%ftpspeed% ""%OVWROUTDIR%"" ""%ftpovwrdirectory%""" "exit"goto endbackupFigured it didn't work before and I am going to bed, so it can't work any less. Hopefully if this is the wrong way to do it I you can let me know and I can change it tomorrow when I get home. If it does work, YAY! Link to comment Share on other sites More sharing options...
Dateranoth Posted October 28, 2010 Author Share Posted October 28, 2010 Sorry. I meant to add a passive option with the last update.You have the right idea just in the wrong place. Add-passivebefore the closing quote after the open command.Im on my phone now but i will update the script when I get home. Link to comment Share on other sites More sharing options...
Shocks Posted October 28, 2010 Share Posted October 28, 2010 So...start winscp.exe /console /command "open %ftploginname%:%ftploginpass%@%ftpurlport% -passive" "synchronize remote -delete -criteria=both -speed=%ftpspeed% ""%OVWROUTDIR%"" ""%ftpovwrdirectory%""" "exit"goto endbackup Link to comment Share on other sites More sharing options...
Dateranoth Posted October 28, 2010 Author Share Posted October 28, 2010 Yep. That should do it. Has it been connecting at all? Just timing out during the process Link to comment Share on other sites More sharing options...
Shocks Posted October 28, 2010 Share Posted October 28, 2010 It has been connecting, but then resetting the connection over and over again until I get locked out on the FTP side, it isn't script related, because it happens even when I run manually.The FAQ for WinSCP said something about routers and firewalls being an issue on occasion, and to run in Passive if that is the case, so that is what I am chalking it up to. Link to comment Share on other sites More sharing options...
Dateranoth Posted October 28, 2010 Author Share Posted October 28, 2010 It has been connecting, but then resetting the connection over and over again until I get locked out on the FTP side, it isn't script related, because it happens even when I run manually.The FAQ for WinSCP said something about routers and firewalls being an issue on occasion, and to run in Passive if that is the case, so that is what I am chalking it up to.I just noticed, I was replying from my phone before, but your code is wrong. You're not using the latest update. If you're using basic ftp you have to use the protocol information I added to the latest release. Without it, winscp defaults to sftp which isn't usually on port 21. This causes it to never connect. So, make sure you either go back a few posts and change the lines I mentioned or just update to the latest version. I'll have another version with -passive support up soon. Link to comment Share on other sites More sharing options...
Shocks Posted October 28, 2010 Share Posted October 28, 2010 Ah, my bad. I assumed that the code you added in was the code you told me to change, so I was effectively updating to the newest code manually.I will update it. I kind of ripped out the WINSCP section of your code and made my own batch file so I can attempted to upload without having to do a full backup everytime. @ECHO OFF::Would you like to use WinSCP FTP to upload the Overviewer map to a web server? (yes or no)::If connecting to a secure ftp the first run will ask you to save the key to cache.::Once saved it will run automatically without user input from that point on. SET useftp=yes::WinSCP is required. Please set the path to WinSCPSET ftpwinscpdir=E:\WinSCP::Set your ftp Protocol (ftp or sftp or scp)SET ftpprotocol=ftp::Set your ftp address here WITHOUT ftp:// (site:port)SET ftpurlport=ftp.zjnewbs.com:21::Set the login name for your FTP.SET ftploginname=map@zjnewbs.com::Set the password for your FTP.SET ftploginpass=XXXXX::Set the max upload bandwidth you want WinSCP to use (kibps)SET ftpspeed=60::Set your REMOTE ftp directory for Overviewer. Should be base directory containing index.html. (Full Remote Path)SET ftpovwrdirectory=/::Attempts to kill WinSCP in case it was still running or stuck from last time.::Starting the FTP Upload Process. It is opened as a seperate process and is not waited for because it can take a long time.:startftpECHO Starting FTP Upload. Process will open in a new window and backup batch will continue to run without waiting.taskkill /im winscp.execd /d "%ftpwinscpdir%"start winscp.exe /console /command "open %ftpprotocol%://%ftploginname%:%ftploginpass%@%ftpurlport% -passive" "synchronize remote -delete -criteria=both -speed=%ftpspeed% ""%OVWROUTDIR%"" ""%ftpovwrdirectory%""" "exit"EXITThat is all it is. I have no actual idea how to do batch, so it is probably hella wrong somewhere and won't work, but maybe it will. Anyways, I will update.Well it seems to be working about as well as I anticipated, that is to say... not.Also I am getting this now:Environment variable VBSDirC:\Users\Administrator\MineCraft not definedStarting Back up of MineCraft World - world1Forcing Server to save worldThe system could not find the environment option that was entered.'saveall.vbs' is not recognized as an internal or external command,operable program or batch file.Starting Initial Run of Backup. New, dated folder will be created and Incr Backups will be stored there until Script restarted.This is a new run of backup script. Updating cache files and creating initial backup. Link to comment Share on other sites More sharing options...
Shocks Posted October 28, 2010 Share Posted October 28, 2010 crap somehow quoted myself instead of editing Link to comment Share on other sites More sharing options...
Dateranoth Posted October 28, 2010 Author Share Posted October 28, 2010 Ok. Lets step back a few. I need you to paste your full backup script contents. I'll edit it manually, and then paste you a link of the batch that should work for you. XXXX out the passwords and then that will be the only thing you need to change. I'll be adding the -passive mode now. BTW, your above ftp script should work for testing. Just need to add this to the top:SET OVWROUTDIR=WHATEVERYOURPATHISYou can also remove "exit" from the end so it doesn't close the window and you can see what's going on. Link to comment Share on other sites More sharing options...
Dateranoth Posted October 28, 2010 Author Share Posted October 28, 2010 ::V2.3-Added option to set ftp open Switches. Useful for enabling -passive mode in ftp--::::-----Also made yes/no variables case insensitive. Case no longer matters.------------::Ok, latest version has a spot to set open variables. Also the wrong case shouldn't cause problems anymore. YeS=yes , eXe=exe etc.::This is where you can set WinSCP switches for connecting. Refer to http://winscp.net/eng/docs/script_commands#open for details.::Main uses are to leave blank for default OR -passive for ftp protocol passive mode.SET ftpswitch=For passive ftp set the variable to:SET ftpswitch=-passive Link to comment Share on other sites More sharing options...
Shocks Posted October 29, 2010 Share Posted October 29, 2010 Whoops, completely forgot about the password, thanks for seeing that. Also I hope all my random problems are actually helping. The VBS thing was because I was stupid and deleted the "=", thought I double checked that, but again, I am stupid. That is what I get for not backing up the old file and having to redo all the preference.Looks good, now I just have to get my friend to disconnect the 20 something instances of myself on the FTP site so I can try uploading. Link to comment Share on other sites More sharing options...
Dateranoth Posted October 29, 2010 Author Share Posted October 29, 2010 Yeah, they are helping. They keep me looking at the code, and because of your inquiries I've updated a number of things I'd overlooked and some things I had planned on doing. I still need to add the option to upload the backup files via FTP, but I will get to it. Keep an eye on the latest revisions. I'm going out of town for the next few days so I probably won't be able to work on it until I get back. Let me know if you have any further suggestions. Link to comment Share on other sites More sharing options...
Shocks Posted October 29, 2010 Share Posted October 29, 2010 Hmm, for some reason it won't connect to the FTP when I do my little testing batch thing. <code>Connecting to ftp.zjnewbs.com ...Connected with ftp.zjnewbs.com. Waiting for welcome message...Access denied.Authentication failed.No session.</code>I double checked the information I have put into the batch, and it matches what I am using on the actual program which lets me connect. Perhaps the batch doesn't like me using special characters in the password? Link to comment Share on other sites More sharing options...
Dateranoth Posted October 29, 2010 Author Share Posted October 29, 2010 I'm betting it's the login name. It has an @ symbol in it which is making it think the name is map and the server is zjnewbs.com. See, you're helping more than you know. I'll update the batch version after this weekend, but this should work for you:Changecd /d "%ftpwinscpdir%"start winscp.exe /console /command "open %ftpprotocol%://%ftploginname%:%ftploginpass%@%ftpurlport% -passive" "synchronize remote -delete -criteria=both -speed=%ftpspeed% ""%OVWROUTDIR%"" ""%ftpovwrdirectory%""" "exit"To:cd /d "%ftpwinscpdir%"start winscp.exe /console /command "open %ftpprotocol%://""%ftploginname%"":""%ftploginpass%""@%ftpurlport% -passive" "synchronize remote -delete -criteria=both -speed=%ftpspeed% ""%OVWROUTDIR%"" ""%ftpovwrdirectory%""" "exit" Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.