![]() ![]() ![]() Also, I think some parts of my code don't even work properly. The rsync command is probably one of the most used commands out there. I am sure there are much more elegant solutions to approach my problem. Sshpass -p my_server_y_password ssh -p "my_server_x_password" scp server_y/file/pathĪnd, after this, I should run my script * * 20 * * my_bash_script.sh # somehow check if file from server_x exists (currently I don't know how to do it on a different server) At the same time, SFTP allows you to continue an interrupted file transfer. I think that the code should look like (inside my_bash_script.sh) year_month="$(date +'%Y%m')" Rsync is a very useful and widely used tool that can be used to transfer or synchronize files between local and remote servers. You can not resume an interrupted file transfer with SCP. If the file does not exist, it shouldn't do anything I want to get this code to run on 20th of every month and also use the YYYYMM date format for searching the file. SCP (Secure Copy Protocol) is a network protocol used to securely copy files/folders between Linux ( Unix) systems on a network. Currently I follow the following steps for copying a file from server_x to server_y (Let's suppose I run this code on 20th April 2021 = 202104) sshpass -p "my_server_y_password" ssh -p "my_server_x_password" scp server_y/file/path ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |