Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch File to Upload SQL to FTP

    Does anyone have a bat file to upload shorewareConfigDump.sql to ftp server? Thanks

  • #2
    @echo off
    REM Set drive to the program files\shoreline communications\shoreware server directory
    REM Set username to ftp username
    REM Set password to ftp password
    REM Set Directory to ftp directory
    REM Set Name to Customer Name without spaces
    REM Also, I recomend using the at command vs windows task manager for running automated tasks. Much more stable and reliable.
    Set drive=c
    Set username=ftp_username
    Set password=ftp_password
    Set dir=directory_on_ftp_site
    SET name=unique_name_if_doing_multiple_customers
    "%drive%:\\Program Files\\Shoreline Communications\\Shoreware Server\\MySQL\\MySQL Server 5.0\\bin\\mysqldump.exe" --user root --password=shorewaredba --databases shoreware --routines --single-transaction>>"%drive%:\%name%_shorewareconfig.sql"
    echo open ftp.packetfusion.com>>"%tmp%\ftp.txt"
    echo %username%>>"%tmp%\ftp.txt"
    echo %password%>>"%tmp%\ftp.txt"
    echo cd %dir%>>"%tmp%\ftp.txt"
    echo del %name%_shorewareconfig.sql>>"%tmp%\ftp.txt"
    echo send %drive%:\\%name%_shorewareconfig.sql>>"%tmp%\ftp.t xt"
    echo close>>"%tmp%\ftp.txt"
    echo quit>>"%tmp%\ftp.txt"
    %windir%\system32\ftp.exe -s:%tmp%\ftp.txt
    del %drive%:\%name%_shorewareconfig.sql
    del "%tmp%\ftp.txt"

    Comment


    • #3
      Thanks

      I owe you one.

      Comment


      • #4
        500 invalid port command

        Does anyone have any ideals on this one. I'm using NAT on an Adtran router. Thanks

        Comment


        • #5
          Try forcing passive FTP
          I think you need to put the keyword PASV in the script somewhere before the transfer.
          echo PASV >>"%tmp%\ftp.txt"
          echo send %drive%:\\%name%_shorewareconfig.sql>>"%tmp%\ftp.t xt"

          Comment

          Working...
          X