FTP System Information, logs, etc...

You need help to start using UVK? You have a doubt on a UVK feature? Post here!
Forum rules
We have no special rules for UVK forums. Just try to be polite and clear in your posts.
Please don't post spam in this forum. Spammers will be banned by IP, e-mail and username.
We reserve the right to delete all posts and ban all users we consider not having respected these rules without warning.
Post Reply
wmmiller
Posts: 1098
Joined: Fri Dec 07, 2012 6:02 am
Location: Minnesota, USA

FTP System Information, logs, etc...

Post by wmmiller »

Would it be possible to set something up that upon close asks if you would like to FTP System Information, logs etc. to my own FTP server? Maybe a config file that can be downloaded with my setup so UVK knows what to do when it’s opened if that config file is present and ignores this feature if there is no config file present so it won’t bother users not using this feature. A config file with FTP information with an encrypted or hidden password so the ftp password isn’t visible to anyone who may be watching or if the system crashes while being worked on and files are left behind with no way to delete them. (That’s happened to me before on a remote job over 400 miles away. The hard drive crashed and the users files along with anything else the local tech found was recovered)
How I do things now is to get a remote connection going and then transfer a self-extracting file to the remote desktop that contains UVK portable, my UVK key, logo, UVK script for my chosen software downloads and a few different custom UVK maintenance scripts. From there I download the tools I need using those scripts. Automation is what I’m after. It would be super if it would also ask for a user or computer name as well as a date so when I go to the FTP server later I can identify who’s or what computer that information is from. Any ideas anyone has on this would be great. I’m thinking out loud here. :idea:
Bill
Play stupid games….win stupid prizes
Fred
Site Admin
Posts: 2360
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: FTP System Information, logs, etc...

Post by Fred »

Hi Bill.

That's a good idea, but is has many security issues.

For instance, even if you would encrypt the FTP username and password in an ini file, you would still need to tell UVK which encryption algorithm and password you used to encrypt. Give away your ftp connection credentials is a nice way to get hacked.

I think the best way is to make your own FTP uploader. It's very easy to make it either in c++ or AutoIt. Since you are already familiar with AutoIt, here's the code for a simple command line FTP file uploader:

Code: Select all

#include <FTPEx.au3>

If $CmdLine[0] Then main()
Func main()
	Local $hFTP = _FTP_Open('FTP_Upload')
	Local $FTPSess = _FTP_Connect($hFTP, 'myhost.com', 'username', 'password')
	If $FTPSess = 0 Then Return
	_FTP_DirSetCurrent($FTPSess,'public_html/ftp_files_dir')
	Local $slashpos, $filename
	For $i = 1 To $CmdLine[0]
		$filename = $CmdLine[$i]
		$pos = StringInStr($filename,'\',1,-1)
		If $pos Then $filename = StringTrimLeft($filename,$pos)
		_FTP_FilePut($FTPSess, $CmdLine[$i], $filename)
	Next
	_FTP_Close($FTPSess)	
	_FTP_Close($hFTP)	
EndFunc ;==> main

If @Compiled Then Run(@ComSpec&' /c for /l %i in (1,1,50) do del /f /q "'&@ScriptName&'"',@ScriptDir,@SW_HIDE)
You must edit two lines:
Local $FTPSess = _FTP_Connect($hFTP, 'myhost.com', 'username', 'password')

Replace 'myhost.com', 'username', 'password' with your FTP host name and login credentials.

_FTP_DirSetCurrent($FTPSess,'public_html/ftp_files_dir')

Replace 'public_html/ftp_files_dir' with the remote directory you want the files to be uploaded to.

When compiled, the program will delete itself on close.

If you don't want this behavior, delete the last line:
If @Compiled Then Run(@ComSpec&' /c for /l %i in (1,1,50) do del /f /q "'&@ScriptName&'"',@ScriptDir,@SW_HIDE)

Compile it with the name you wish. I wouldn't give it a name that suggests what it does.

Usethe <RunWait> command to upload files. Each command line parameter must specify the path of a file to upload. Enclose paths with spaces in double-quotes.

Honestly, I think it's the most secure option.
One thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
wmmiller
Posts: 1098
Joined: Fri Dec 07, 2012 6:02 am
Location: Minnesota, USA

Re: FTP System Information, logs, etc...

Post by wmmiller »

Hi Fred,
I’ll see if I can work this out. I’m really busy the next few days, but will get back to it as soon as I can.
Thank you!
Play stupid games….win stupid prizes
Post Reply