User Tools

Site Tools


linux:scripts:ftpupload

FTP upload

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

ftpupload.sh
#!/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.txt · Last modified: 2017/12/27 13:02 by lunetikk