ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi all
i am writing a script which enolves transfering of data from one server to another,i have almost completed it but i just want to add two things in that which are:-
* is there any swtich avilable scp through which i can specify the password in the script itself
* second while my scp is gng on what condition should i add, so that it will continously show me df -h commond's output,please help
hi all
i am writing a script which enolves transfering of data from one server to another,i have almost completed it but i just want to add two things in that which are:-
* is there any swtich avilable scp through which i can specify the password in the script itself
* second while my scp is gng on what condition should i add, so that it will continously show me df -h commond's output,please help
thanks
Akhil,
Issue 1
You can specify passwordless login through ssh which is what scp uses, the problem with this is that you cannot make it only available to a certain script so you open yourself up to security issues if other people use the machine that the runs the script. Since scp can be used by a machine to send a file to another or it can be used by a machine to grab a file from another computer, if you "backup machine" is not readily accessible by less knowledgeble users, then run it on the "backup machine". Follow this tutorial to set up the passwordless login
Issue 1
You can specify passwordless login through ssh which is what scp uses, the problem with this is that you cannot make it only available to a certain script so you open yourself up to security issues if other people use the machine that the runs the script. Since scp can be used by a machine to send a file to another or it can be used by a machine to grab a file from another computer, if you "backup machine" is not readily accessible by less knowledgeble users, then run it on the "backup machine". Follow this tutorial to set up the passwordless login
Issue 2
I am not sure what you mean. are you running the script via cron or do you run this script manually? Is this to create a "progress bar"?
- Jim
hi Jim,
i will use your tutorial for the issue one and about second i want to use the df -h commond,so that i would be aware of disk space issue while data is being transfered,so is it possible that while my script is executing scp,i can get df -h information too.
hi Jim,
i will use your tutorial for the issue one and about second i want to use the df -h commond,so that i would be aware of disk space issue while data is being transfered,so is it possible that while my script is executing scp,i can get df -h information too.
I still don't understand. Do you want to know that information before/after the script run manually, or do you want a report after an automated run of the script, or do you want the script to only backup if there is space?
You cannot do what you want (with the df -h) directly. One method is to have a second ssh connection whose sole purpose is to watch the df -h output. Another option is to use ssh with redirection instead of scp. For example, suppose you have:
thanks you all for replying.....it has solved my prob quite a bit but what i exactly want is that till my scp is in process, i should constantly get an update on the disk space,so that i can kill scp if there is no disk space
can some one tell me,something regarding this
Quote:
Originally Posted by jimbo1708
I still don't understand. Do you want to know that information before/after the script run manually, or do you want a report after an automated run of the script, or do you want the script to only backup if there is space?
what i exactly want is that till my scp is in process, i should constantly get an update on the disk space,so that i can kill scp if there is no disk space
First, scp should die by itself if there is not sufficient disk space. Second, as I said before, you cannot do this directly with scp. Third, you didn’t say what was wrong with the suggestion I posted. Did you try it? It accomplishes the equivalent of what you ask.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.