#!/bin/bash DIR="/home/USER/weather" SFTPPASS="PASS OR REPLACE WITH KEY" SFTPUSER="USER@DOMAIN.TLD" URL="DOMAIN.TLD/PATH/FILE.EXT" cd $DIR cp records/humi* ftp/ cp records/ambi* ftp/ cp records/temp* ftp/ cp records/baro* ftp/ cd ftp # Using a plain password here is evil, but in my context sadly needed # better use key-authentication, and switch the commented lines #sftp -oBatchMode=no -b - $SFTPUSER <>logs/ftp.log date>>logs/ftp.log echo "finished\n\n">>logs/ftp.log python move.py