shell script ftp auto upload

Опубликовано: 24 Октябрь 2024
на канале: Classmates
13,057
105

#!/bin/bash
HOST=ftp.example.com
USER=ftpuser
PASSWORD=P@ssw0rd

ftp -inv $HOST (double less than sign) EOF
user $USER $PASSWORD
cd /path/to/file
mput *.html
bye
EOF
where i = interactive mode / -n = auto login / -v = verbose
EOF means this script will execute the below lines until it gets another EOF
you can write any keyword insted EOF but make both starting and ending should not mismatch
make sure this script and file which u upload is in the same location