Nancy:

Here's a quick little ftp script you can use.

- - - - -

@rem ** This is a backup script to save the needed files and ftp them to
@rem ** another server on the network.
@rem **********************************************************************
@rem ** Set local variables
@rem **********************************************************************
@set currMon=%date:~4,2%
@set currDay=%date:~7,2%
@set currYr=%date:~10,4%
@set EmailDir=C:\inetpub\mailroot\Pickup
@set [EMAIL PROTECTED]
@set [EMAIL PROTECTED]
@set ToDir=E:\Backups\
@set ToArchive=%ToDir%Archive\
@set ScriptFile=%ToDir%Scripts\
@set FilePrefix=ht2_
@set ConfigFile=BackupConfig.bks
@set currName=%FilePrefix%%currYr%%currMon%%currDay%.bkf
@set currLog=%FilePrefix%%currYr%%currMon%%currDay%.log
@set zipName=%FilePrefix%%currYr%%currMon%%currDay%.zip
@set rarName=%FilePrefix%%currYr%%currMon%%currDay%.rar

@rem **********************************************************************
@rem ** Begin building log/email file
@rem **********************************************************************
echo x-sender: %FrEmail% >> %ToDir%%currLog%
echo x-receiver: %ToEmail% >> %ToDir%%currLog%
echo From: %FrEmail% >> %ToDir%%currLog%
echo To: %ToEmail% >> %ToDir%%currLog%
echo Subject: My HT2 backup >> %ToDir%%currLog%
echo.>> %ToDir%%currLog%
echo.>> %ToDir%%currLog%

echo Ht2 Backup now starting on %date% at %time% >> %ToDir%%currLog%

@rem **********************************************************************
@rem ** Execute the actual Windows backup
@rem **********************************************************************
echo ...now starting Windows NTBackup on %date% at %time% >>
%ToDir%%currLog%
@ntbackup backup "@%ScriptFile%%ConfigFile%" /m normal /j "Ht2 Backup" /f
"%ToDir%%currName%" /l:f

@rem **********************************************************************
@rem ** Zip up the file
@rem **********************************************************************
echo ...zipping (RAR) is now starting on %date% at %time% >>
%ToDir%%currLog%
D:\WinRAR\rar.exe A %ToDir%%rarName% %ToDir%%currName%

@rem **********************************************************************
@rem ** Ftp the backup to the storage server
@rem **********************************************************************
echo ...now ftp'ing files to storage server on %date% at %time% >>
%ToDir%%currLog%
@call E:\Backups\Scripts\Ftp.bat >> %ToDir%%currLog%

@rem **********************************************************************
@rem ** Archive the current backup file
@rem **********************************************************************
echo.>> %ToDir%%currLog%
echo ...now archiving backup file on %date% at %time% >> %ToDir%%currLog%
@rem @copy %ToDir%%currName% %ToArchive%%currName% >> %ToDir%%currLog%
@copy %ToDir%%rarName% %ToArchive%%rarName% >> %ToDir%%currLog%

@rem **********************************************************************
@rem ** Delete the current backup file and compressed file
@rem **********************************************************************
echo ...now deleting current directory of backup files %date% at %time% >>
%ToDir%%currLog%
@del %ToDir%%currName% >> %ToDir%%currLog%
@del %ToDir%%rarName% >> %ToDir%%currLog%

@rem **********************************************************************
@rem ** Finish updating the log/email file
@rem **********************************************************************
echo.>> %ToDir%%currLog%
echo Ht2 Backup now completed on %date% at %time% >> %ToDir%%currLog%

@rem **********************************************************************
@rem ** Copy log to email directory and storage then delete it
@rem **********************************************************************
@copy %ToDir%%currLog% %EmailDir%
@copy %ToDir%%currLog% %ToArchive%%currLog%
@del %ToDir%%currLog%

@rem **********************************************************************
@rem ** End script
@rem **********************************************************************
exit

The ftp script looks like:

@echo OFF
rem * This batch and text file illustrate the use of FTP to upload an
rem * ASCII file to an SFTP server using a 3rd party product.
rem *
@echo ON
@cd /d E:\Backups
@rem ftp -i -s:E:\Backups\Scripts\ftp.txt 192.168.1.11
sftpc -profile="E:\Backups\Scripts\MyDotNet1.tlp"
-cmdFile="E:\Backups\Scripts\ftp.txt"

And the ftp feed file looks like:

cd /MyDotNet2
put *.rar
put *.log
Quit

- - -

Hope this helps.

Bill
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bob Woodward
Sent: Wednesday, March 07, 2007 2:27 PM
To: [email protected]
Subject: RE: [U2] FTP

The difference between Bill's ">" and the ">>" I suggested is that Bill's
will overwrite each time it's executed and the ">>" will append to the end
of the file if it already exists.  Both will create the file if it does not
already exist.

BobW
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bill Haskett
Sent: Wednesday, March 07, 2007 2:09 PM
To: [email protected]
Subject: RE: [U2] FTP

Nancy:

If I understand you correctly you're using your "client" PC to ftp the file.
I believe you can direct the ftp output like:

CMD = "FTP -s:\\OURSERVER1\Flatfile\FTP.EXPORT\ftpscript1.txt >
C:\FtpTransfer.txt"

I do this in backup scripts on various servers that email the results to me.
So, theoretically, you could set up the script on the Windows server (if
you're using Windows), or on a Linux server, to do the same thing without
using AccuTerm.

Bill

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nancy Fisher
Sent: Wednesday, March 07, 2007 1:55 PM
To: [email protected]
Subject: [U2] FTP

I'm using AccuTerm DOSSVC to place a file on  remote FTP site.  It always
shows up exactly like I want.
But I need to capture the results so I can automate it (just in case it
doesn't go).

The Basic program (AccuTerm) DOSSVC uses this syntax:
   EQU ESC TO CHAR(27)
   EQU STX TO CHAR(2)
   EQU CR TO CHAR(13)

  PRINT ESC:STX:'<':CMD:CR

The command is:  CMD = "FTP
-s:\\OURSERVER1\Flatfile\FTP.EXPORT\ftpscript1.txt"

and the ftpscript1.txt is:

    open ftp.somesite.com
    ourusername
    ourpassword
    ascii
    cd /
    send \\OURSERVER1\Flatfile\OURCLIENT\FILETOSEND.EDI
    bye

I don't know if I need to know DOS/FTP or BASIC or AccuTerm syntax to return
the result of the transfer absolutely ANYWHERE (variable or file).

I am practically clueless on DOS/FTP and have struggled to get this far.
Since I can send the file I am very
frustrated at not being able to manage the result.

I have tried the AccuTerm forum...and no luck so far.

We are on Windows/UniVerse.

thanks,
Nancy
[EMAIL PROTECTED]
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to