Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Will shell script executes in sequence

$
0
0
I have a shell script scheduled in cron job to run at every 1 minute which transfers files to remote machine and then move the files to backup folder.

Code:

cd /u01/app/ftp_tmp
sftp user@hostname <<-EOF
cd /home/user/ftp
mput *
bye
EOF
mv /u01/app/ftp_tmp/* /u01/app/ftp_bkp

Now the problem is it transfers the file to remote machine incompletely, but it has the completed file in backup folder.
So I wanted to know how it comes to the last command before completing the file transfer. Please assist.

Viewing all articles
Browse latest Browse all 16232

Trending Articles