Site Tools


linux:scripts:ftpupload

This is an old revision of the document!


FTP upload

This script can be used to upload all .txt files from a folder to your ftp.

#!/bin/bash
 
#var Hostname
HOST='localhost'
 
#var Username
USER='root'
 
#Path to data on FTP
FTPPATH=/var/ftp/
 
#Path to local .txt files
FILEPATH=/var/textfiles/*.txt
 
#Connect to FTP via SecureFTP (SSH needed) and upload files from FILEPATH to FTPPATH
sftp -b - ${USER}@${HOST} << EOFFTP
put $FILEPATH $FTPPATH
quit
EOFFTP


linux/scripts/ftpupload.1511971014.txt.gz · Last modified: 2017/11/29 16:56 by lunetikk