linux - Shell Script - SFTP -> If copied, remove? -


iam trying copy textfiles shellscript on sftp. wrote script job.

#!/bin/bash  host='servername' user='username'  sftp -b - ${user}@${host} << eofftp  /files/*.txt /tmp/ftpfiles/ rm /files/*.txt  quit  eofftp 

before remove textfiles on ftp, want make sure, copied files without errors. how can this? use ssh-keys login.

task is: copy textfiles on , on make sure, not same ones... (thats why use remove...)

maybe move them on ftp? copy , move /files/copied ?

actually, rsync ideal this:

rsync --remove-source-files ${user}@${host}:/files/*.txt /tmp/ftpfiles/ 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -