@Almeida
@Sebastian-Roth
this is a simply example, security is by your side:
#!/bin/bash
SERVER=$1
USERNAME=$2
PASSWORD=$3
FILE=$4
USER_TO_LAST=$5
echo "Result from last $USER_TO_LAST" &> $FILE
last $USER_TO_LAST &>> $FILE
lftp -u $USERNAME,$PASSWORD $SERVER << EOF
put $FILE
EOF
Configure as on image:
Snapin template is bash.
example.png
Tested on Linux Mint 19.