FTP upload batch program 
Author Message
 FTP upload batch program

Quote:

> I'm looking for a program, REXX would be great, that would upload
> website files (HTML, GIF, JPEG, *.ZIP, etc.) as needed to update the
> server with the latest version from my development system.

> My concept would be a simple command line program that would upload
> recently updated files from a local directory tree to an identical tree
> on the server. I'd also like a list of files that were updated.

> Currently, I'm using FTP-PM, but I'm becoming bored with it.

> I'd appreciate someone sharing their routine or pointing me in the
> right direction. It seems like something that's been done a thousand
> times before and I'd rather not invent the wheel again.

Hello Barry,

here is what I suggested to another person with a similar problem:

I would write a rexx script to build a NETRC file and then
run ftp.exe. Look at the following example that should
be a good start to create your own:

/* Sample FTP script */

call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs

ignore = setlocal()
env="OS2ENVIRONMENT"
tempvar = value("TEMP",,env)
netrcfile = tempvar || "\mynetrc"
call value "NETRC", netrcfile, env
rc = sysfiledelete(netrcfile)
ftpcmd = "ftp localhost"

call lineout netrcfile, "machine localhost"
call lineout netrcfile, "login mylogin"
call lineout netrcfile, "password mysecretpassword"
call lineout netrcfile, "macdef init"
call lineout netrcfile, "bin"
call lineout netrcfile, "dir"
call lineout netrcfile, "quit"
call lineout netrcfile, ""
call lineout netrcfile

address cmd ftpcmd
rc = sysfiledelete(netrcfile)
ignore = endlocal()

/* end of script */

--
Bye/2
Meinolf



Sat, 18 Dec 2004 14:47:35 GMT  
 FTP upload batch program


Quote:
>I'm looking for a program, REXX would be great, that would upload website
>files (HTML, GIF, JPEG, *.ZIP, etc.) as needed to update the server with
>the latest version from my development system.
>My concept would be a simple command line program that would upload
>recently updated files from a local directory tree to an identical tree
>on the server. I'd also like a list of files that were updated.
>Currently, I'm using FTP-PM, but I'm becoming bored with it.
>I'd appreciate someone sharing their routine or pointing me in the right
>direction. It seems like something that's been done a thousand times
>before and I'd rather not invent the wheel again.

Well, you can find the code to determine what files have changed in the
tree here <http://www.catherders.com/treesync.shtml>.  It would be fairly
simple to change the appropriate copy commands to rxsock calls.

Mike-

-------------------------------------------------------------------
              My web page is at http://www.catherders.com

          Because network administration is like herding cats.
-------------------------------------------------------------------

Due to the amazing (and disgusting) amount of unsolicited email  (spam) we
have been receiving, site-wide email filters have been  installed at
catherders.com. Exact details of how this has been  configured will not be
disclosed (I don't want the darned spammers  to figure workarounds), but I
will say that mail from .tw and .kr  domains is bounced without exception.
If this makes PacRim folks  unhappy, get those open relays fixed, folks!

-------------------------------------------------------------------

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----



Sat, 18 Dec 2004 18:18:22 GMT  
 FTP upload batch program

Quote:

>I'm looking for a program, REXX would be great, that would upload
>website files (HTML, GIF, JPEG, *.ZIP, etc.) as needed to update the
>server with the latest version from my development system.

>My concept would be a simple command line program that would upload
>recently updated files from a local directory tree to an identical tree
>on the server. I'd also like a list of files that were updated.

>Currently, I'm using FTP-PM, but I'm becoming bored with it.

I'm using sitecopy (http://www.lyra.org/sitecopy/) and I don't get
bored with it as it does all the work... There are OS/2, Windows and
Unix versions.

Bye
Dennis

----------------------------

http://www.labyrinth.net.au/~dbareis/index.htm
   * PPWIZARD, HTML preprocessor (or rexx/Javascript etc) - #define, #include, #import SQL, #if)
   * URL Checker (check external links in web pages)
----------------------------



Sun, 19 Dec 2004 09:20:01 GMT  
 FTP upload batch program
Hi -

The program below uses the rxFTP parts of IBM Object Rexx, and was cloned
and modified from their sample program. Obviously it deson't do what you
need to do, but it shows some of the capabilities of the package. You could
just interface ordinary Rexx to the system programs that can do ftp things,
but this way might be more fun.

Ian

/*=================================================================*/
/* dirFile.rex:   */
/*=================================================================*/

Drives. = ""                        -- initialize Drives stem
--

--
call GetDrives;                     -- check input
--

curdir = directory();

parse var curdir curDrv '\' . ;

curDirSpec = curDrv || '\*.*';

say 'curDirSpec: ' curDirSpec;

call sysFileTree curDirSpec, dirs, 'D' ;

folder. ="";
do i = 1 to dirs.0
   parse var dirs.i . . . . folder.i
   -- say folder.i
end
folder.0 = dirs.0;

exit 0

/*****************************************************************************/

/*
*/
/* Procedure   :
GetDrives                                                   */
/*
*/
/* Description : get all available
drives                                    */
/*               parse the input string and ignore all characters which
are  */
/*               not
alphanumeric                                            */
/*               save all alphanumeric characters to "Drives"
stem           */
/*
*/
/* Parameters  : EXPOSE : Drives.      - stem for drives
information         */
/*
*/
/*****************************************************************************/

GetDrives: PROCEDURE EXPOSE Drives.

InputDrives = SysDriveMap();      -- RAW InputDrives = 'C: D: E: ' etc. --

InputDrives = translate(InputDrives,' ', ':')

j = 1
do i = 1 to length(InputDrives)
   Drive = substr(InputDrives,i,1)
   if datatype(Drive,'A') = 1 then                -- if an alpha     --
      if datatype(Drive,'N') = 0 then             -- if not a number --
      do
        Drives.j.InputLetter = translate(Drive) || ":"
        say "Drives.j.InputLetter: " Drives.j.InputLetter
        Drives.0 = j
        j = j + 1
      end
end

return

 say 'drive        : ' driv;
 say 'fold.1       : ' p.1;
 say 'fold.1.1     : ' p.1.1;
 say 'fold.1.1.1   : ' p.1.1.1;
 say 'fold.1.1.1.1 : ' p.1.1.1.1;

 newdir = directory("..");
 say 'Curr Dir: ' curdir;
 say 'New  Dir: ' newdir;
 exit 0

/* Define the variables for:                                       */

     server = 'ftp.xxxxx.net'  /* IP address or server name   */
     userid = 'myuseridr'
     passwd = 'mypass'
     trclog = 'logfile.txt'         /* Trace log file name         */
     rc     = 0                     /* Set return code to 0        */

/* Ensure that the function package is properly registered:        */
If RxFuncQuery('FtpDropFuncs') then
  Do
    rc = RxFuncAdd('FtpLoadFuncs', 'rxftp', 'FtpLoadFuncs')
    rc = FtpLoadFuncs()
  End

If rc <> 0 then
  Do
    Say ' *** FTP functions could not be loaded.'
    EXIT rc
  End

/* Start tracing FTP commands and logging of replies               */
rc = FtpTrace()
rc = FtpTraceLog( trclog, '1')

If rc = 0 then
  Say ' Replies will be written to log file: 'trclog'.'
Else
  Say ' No writing to log file: 'trclog' possible.'

/* Define remote host and user to be used during the session        */
rc = FtpSetUser(server, userid, passwd)
If rc = 1 then
  Say ' Settings for a connection are stored.'
Else
  Call Terminate " *** Settings for connection failed."

/* S/390 FTP servers need to be put in active mode                  */
rc = FtpSetActiveMode('1')
If rc = 1 then
  Say ' Active mode has been set.'
Else
  Call Terminate " *** Active mode setting has failed."

/* Transfer an ASCII file from the remote ftp server                */
rc = FtpGet('index.html', 'index.html', 'ASCII')
If rc = 0 then
  Call Terminate ' File has been received. '
Else
  Call Terminate " *** File has NOT been received."

/* Terminate the file transfer                                      */
Terminate:
  Parse Arg Message
  Say Message
  Call FtpLogoff   /* Log off (sends QUIT command to the server)    */
  Call FtpTraceLogOff  /* Stop logging - close log file.            */
  Call FtpTrace
  Call FtpDropFuncs    /* Remove the function package.              */
EXIT rc

Quote:

> I'm looking for a program, REXX would be great, that would upload
> website files (HTML, GIF, JPEG, *.ZIP, etc.) as needed to update the
> server with the latest version from my development system.

> My concept would be a simple command line program that would upload
> recently updated files from a local directory tree to an identical tree
> on the server. I'd also like a list of files that were updated.

> Currently, I'm using FTP-PM, but I'm becoming bored with it.

> I'd appreciate someone sharing their routine or pointing me in the
> right direction. It seems like something that's been done a thousand
> times before and I'd rather not invent the wheel again.

> -----------------------------------------------------------

> wordgame:123(abc):<14 9 20 5 2 9 18 4 at 22 15 9 3 5 14 5 20 dot 3 15
> 13> (Barry Mann)
> [sorry about the puzzle, SPAMers are ruining my mailbox]
> -----------------------------------------------------------



Sun, 19 Dec 2004 12:13:52 GMT  
 FTP upload batch program
REXX for OS/2 has a built-in FTP API, that you can use to code your own
solution.


Quote:
> I'm looking for a program, REXX would be great, that would upload
> website files (HTML, GIF, JPEG, *.ZIP, etc.) as needed to update the
> server with the latest version from my development system.

> My concept would be a simple command line program that would upload
> recently updated files from a local directory tree to an identical tree
> on the server. I'd also like a list of files that were updated.

> Currently, I'm using FTP-PM, but I'm becoming bored with it.

> I'd appreciate someone sharing their routine or pointing me in the
> right direction. It seems like something that's been done a thousand
> times before and I'd rather not invent the wheel again.

> -----------------------------------------------------------

> wordgame:123(abc):<14 9 20 5 2 9 18 4 at 22 15 9 3 5 14 5 20 dot 3 15
> 13> (Barry Mann)
> [sorry about the puzzle, SPAMers are ruining my mailbox]
> -----------------------------------------------------------



Sun, 19 Dec 2004 13:38:11 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. batch ftp

2. Script To automate ftp uploading

3. Uploading a file using FTP

4. Need an FTP Upload thing

5. icetips ftp upload

6. FTP Upload in Background

7. How to upload a file onto a webpage using LabVIEW FTP server

8. hForth v0.9.A uploaded to ftp.taygeta.com

9. hForth v0.9.9 uploaded to ftp.taygeta.com

10. ftp upload with regina

11. FTP Site to upload VHDL material?

12. FTP Upload

 

 
Powered by phpBB® Forum Software