0
1
I am using standard SFTP in Linux and I want to check if there is a file in the file folder before I execute my script.
My script would only get the all the .TXT files in the file folder then would need to delete them after (since I can only copy but not cut files using SFTP)
This would be my script:
It copies all the .TXT files from drive E then save them into local/inbound folder:
#!/bin/bash
get /E:/*.TXT /local/inbound
rm /E:/*.TXT
bye
The reason I am asking is I do not want my remove file script to run when there is no file in the folder as there may be a case wherein between copy and delete, a file will be entered in the E: folder.