I have a bash script that logs into a remote server, pulls a file, then copies it on the local server to a subfolder. I want to run this as a scheduled cron job, so I don't want it printing any output. I managed to suppress the connection output by using the -q flag to the sftp command. But this script still prints:
sftp> get Export/data.xml
How do I go about suppressing this output? Below is my script.
sftp -q user@server.com <<EOF
get Export/data.xml
EOF
cp data.xml ./www/_resources/data