| Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
bw:ftp_and_bizweaver [2019/01/18 11:29] runger [Sample Command File] |
bw:ftp_and_bizweaver [2022/04/22 10:30] (current) akoehler [Sample Command File] |
| The batch file serves two purposes. First, it initiates the winSCP application and indicates which command file is to be used. This is the second line in the sample that follows. Second, it writes information to a log file. The log file captures the start and end times of each run, as well as the details returned from winSCP about the FTP process. This information can be very helpful when troubleshooting transfer issues. | The batch file serves two purposes. First, it initiates the winSCP application and indicates which command file is to be used. This is the second line in the sample that follows. Second, it writes information to a log file. The log file captures the start and end times of each run, as well as the details returned from winSCP about the FTP process. This information can be very helpful when troubleshooting transfer issues. |
| |
| Note that the various files are placed in a folder named "FTP Controls" in the main Bizweaver folder "C:\ProgramData\Bizweaver". Any folders accessible by Bizweaver can be used for this purpose. Just update the path names in the script. Keep in mind that if you use the path noted in the sample you will need to create the "FTP Controls" folder. | Note that the various files are placed in a folder named "FTPControls" in the main Bizweaver folder "C:\ProgramData\Bizweaver". Any folders accessible by Bizweaver can be used for this purpose. Just update the path names in the script. Keep in mind that if you use the path noted in the sample you will need to create the "FTPControls" folder. |
| |
| <file bat winSCP_Main.bat> echo Starting FTP transfer at %date% : %time% >> "C:\ProgramData\Bizweaver\FTP Controls\FTPLog.txt" | <file bat winSCP_Main.bat> echo Starting FTP transfer at %date% : %time% >> "C:\ProgramData\Bizweaver\FTP Controls\FTPLog.txt" |
| "C:\Program Files (x86)\WinSCP\winscp.com" /script="C:\ProgramData\Bizweaver\FTP Controls\WinSCP_Command.txt" >> "C:\ProgramData\Bizweaver\FTP Controls\FTPLog.txt" | "C:\Program Files (x86)\WinSCP\winscp.com" /script="C:\ProgramData\Bizweaver\FTPControls\WinSCP_Command.txt" /log="C:\ProgramData\Bizweaver\FTPControls\winscp.log" /loglevel=0 /logsize=5*5M" |
| echo Ending FTP transfer at %date% : %time% >> "C:\ProgramData\Bizweaver\FTP Controls\FTPLog.txt" </file> | echo Ending FTP transfer at %date% : %time% >> "C:\ProgramData\Bizweaver\FTPControls\FTPLog.txt" </file> |
| |
| ==== Command File ==== | ==== Command File ==== |
| The "command" file is simply a text file with information used by winSCP during execution. A sample file is provided below to show how the main options are defined. | The "command" file is simply a text file with information used by winSCP during execution. A sample file is provided below to show how the main options are defined. |
| |
| <WRAP center round tip 60%> | <WRAP center round tip> |
| You can use the winSCP application to generate the command file for you. Information on the this process is found here https://winscp.net/eng/docs/ui_generateurl. Copy the script that is created using this process and save it as your "command" file. | You can use the winSCP application to generate the command file for you. Information on the this process is found here https://winscp.net/eng/docs/ui_generateurl. Copy the script that is created using this process and save it as your "command" file. Be sure to save the file with the name defined in the batch file. |
| </WRAP> | </WRAP> |
| |
| # The option does not necessarily need to be used. | # The option does not necessarily need to be used. |
| # The target folder may need to be changed | # The target folder may need to be changed |
| ## get -delete *.csv C:\ProgramData\Bizweaver\FTP_In | ## get -delete *.csv C:\ProgramData\Bizweaver\FTP_In\ |
| # | # |
| # Upload the file to current working remote folder | # Upload the file to current working remote folder |