Sponsored Content
Operating Systems Solaris Checking a file on a remote windows server Post 302298815 by Keepcase on Wednesday 18th of March 2009 05:03:25 PM
Old 03-18-2009
Checking a file on a remote windows server

Hi Everyone!

This is what I need to do...
I am deploying some directories over to a windows server 2000/3 box from my solaris10 box and I need to make sure the directories exist.



The only form of connection I have to work with is SSH
Currently, my script deploys the directories over to the windows box using SCP. After each scp command I want to verify the existing directories on the windows box


I am still new to this and I am having a hard time wrapping my head around this...

when I ssh into the windows box I only have windows commands to work with

Is there another way to do this?

the only way I could think of was to

1) scp the directories
2) scp a batch file which checks for the existance of the directory and output exist or notexist to a txt
3) send the output back to my solaris10 box
4) then use some commands on the solaris box to determine if the txt exist (exit=0) or notexist(exit=1)

I was hoping one of you could enlighten me and throw out some thoughts on how to go about this..

thank you so much

Erin
 

9 More Discussions You Might Find Interesting

1. IP Networking

Checking for availability of remote server

Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas? My command looks like: `ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER ` This check should be... (1 Reply)
Discussion started by: dylanmilks
1 Replies

2. Shell Programming and Scripting

Checking for availability of remote server

Hi. In my KSH script I'm running a command on a remote server. I want to know how I can test to see if the remote server is available (accessible) prior to running the command. Any ideas? My command looks like: `ssh $USER@$TARGET_SERVER_DNS ls -l $REMOTE_FOLDER ` This check should be... (4 Replies)
Discussion started by: dylanmilks
4 Replies

3. Linux

Install Linux on remote server from Windows PC

I am very new with servers and have never used Linux. The server I'm looking at is not currently connected to anything, and I wish to install Linux on this server. It doesn't have a monitor (no video card) or keyboard. It does have a DVD. Can I communicate with that server using a Windows PC to... (8 Replies)
Discussion started by: kvalenti
8 Replies

4. Shell Programming and Scripting

Checking the file in remote server using SFTP

Hello, I would appreciate if any one can help me on this. The below script start running at 12:30AM. Every 5 min, i go and check the remote site. If i see filewatch.txt over there, then i need to call another shell script and load the data into database. If i don't see that file, then i have to... (2 Replies)
Discussion started by: govindts
2 Replies

5. Shell Programming and Scripting

FTP using script not working (for transfering file from a remote unix server to windows PC.)

hi, Im using the following code for FTP #!/usr/bin/ksh ftp -v -n "10.29.45.11" << cmd user "mahesva" "mahesva123" get rtl.tar quit cmd Below is the log when i run the above code ********************************** Connected to 10.29.45.11. 220 (vsFTPd 2.0.1) 530 Please login with USER... (20 Replies)
Discussion started by: dll_fpga
20 Replies

6. UNIX for Dummies Questions & Answers

Checking files in remote server and decide to copy file or not

Hi there, I have a problem in my script, I need to check whether file exists in remote server or not, if the file exists, then stop copy else copy the file to the server.. my code is something like this while read $server do if ssh $server "cd $directory_name; if ; then echo "Error:... (2 Replies)
Discussion started by: beezy
2 Replies

7. Shell Programming and Scripting

To run a shell script in remote server from windows batch file

Hi all, i need to run a shell script on remote server. I have created file .bat file in windows server with following code, c:\Users\Desktop\putty.exe -ssh -pw password user@server ./script.sh i need to run the script.sh in my remote server Above command is not working, any... (4 Replies)
Discussion started by: rammm
4 Replies

8. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

9. Shell Programming and Scripting

Checking integrity copied from remote server using UNIX command

I am getting a file (abc.txt) using scp from remote server. scp <connect string> -i $HOME/.ssh/id_dsa rem_id@hostname:/var/prod/abc.txt /var/prod/abc.out Before loading I need to check if the file is indeed same , for that I thought of checking the line count but when I used ssh command it was... (3 Replies)
Discussion started by: lalitpct
3 Replies
chooseDirectory(3)					User Contributed Perl Documentation					chooseDirectory(3)

NAME
chooseDirectory - pops up a dialog box for the user to select a directory. SYNOPSIS
$widget->chooseDirectory( ?option value ...? ); DESCRIPTION
The method chooseDirectory is implemented as a perl wrapper on the core tk "command" tk_chooseDirectory, and $widget is passed as the argument to the hidden -parent option. The chooseDirectory method pops up a dialog box for the user to select a directory. The following option-value pairs are possible as command line arguments: -initialdir dirname Specifies that the directories in directory should be displayed when the dialog pops up. If this parameter is not specified, then the directories in the current working directory are displayed. If the parameter specifies a relative path, the return value will convert the relative path to an absolute path. This option may not always work on the Macintosh. This is not a bug. Rather, the General Controls control panel on the Mac allows the end user to override the application default directory. -parent $widget Makes $widget the logical parent of the dialog. The dialog is displayed on top of its parent window. -title titleString Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed. -mustexist boolean Specifies whether the user may specify non-existant directories. If this parameter is true, then the user may only select directories that already exist. The default value is false. CAVEATS
Perl does not have a concept of encoded filesystems yet. This means that operations on filenames like "opendir" and "open" still use byte semantics. Tk however uses character semantics internally, which means that you can get filenames with the UTF-8 flag set in functions like "chooseDirectory", "getOpenFile" and similar. It's the user's responsibility to determine the encoding of the underlying filesystem and convert the result into bytes, e.g. use Encode; ... my $dir = $mw->chooseDirectory; $dir = encode("windows-1252", $dir); opendir DIR, $dir or die $!; ... See also "When Unicode Does Not Happen" in perlunicode and "Unicode in Filenames" in perltodo. EXAMPLE
my $dir = $mw->chooseDirectory(-initialdir => '~', -title => 'Choose a directory'); if (!defined $dir) { warn 'No directory selected'; } else { warn "Selected $dir"; } SEE ALSO
Tk::getOpenFile, Tk::getOpenFile KEYWORDS
directory selection dialog perl v5.16.3 2014-06-10 chooseDirectory(3)
All times are GMT -4. The time now is 07:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy