As Technet Gallery is retiring so moving the code to Git Hub. (click below github download link for this script)
Hi Readers,
We got a requirement to upload files to ftp from an application server that will drop files to particular folder.
So we have created a nice shell script to do this job & scheduled it via windows task manager.
Script does the following:
- It will check if the source folders have files to process , if not than it will exit
- Upload those files to FTP
- Files that have been uploaded are moved to processed folder (folder name is time stamped)
- Error checking–> if there is error while processing it wll email.
- Detailed logging has been added.
Download & extract the script, below are the variables that I have used , you can change them accordingly
###########################Variables######################################
$smtpServer = “smtp.lab.com” # Change
$fromadd = “DoNotReplyftp@lab.com” # Change
$email1 = “Vikas.Sukhija@lab.com” # Change
$ftp = “ftp://127.0.0.1/” # Change
$user = “vikas” # Change$pass = “password” # Change
$uploadfpath = “C:\Uploadftp\ftpfiles” # Define the Folder from where files will be uploaded
###########################################################################
here is what it will look like, after changing the variables, you just have to run the batch file
Tech Wizard