How to replace a file on Unix server with file from my c: drive


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to replace a file on Unix server with file from my c: drive
# 1  
Old 12-21-2011
Question How to replace a file on Unix server with file from my c: drive

I have a Logging.xml file located on my laptop c: drive. I want to take this file and replace the Logging.xml that is currently on my Aix 6.1 Unix server with it.

Here is the where the file is located. It is the Logging.xml file

Code:
spkupa401:(/WebSphere/MicroStrategy/HealthCenter/spkupa401.cdev.c.net-GUI) $ls -l
total 40
-rw-rw-r--    1 mstr     staff            85 Sep 20 10:17 Connection.xml
drwxrwsr-x    2 mstr     staff           256 Sep 20 10:16 DownLoad
-rw-rw----    1 mstr     staff           178 Sep 15 18:41 GUIConfigWiz.xml
-rw-rw----    1 mstr     staff           636 Jun 14 2011  JavaConfigGUI.xml
-rw-rw-r--    1 mstr     staff          2493 Sep 19 17:10 Logging.xml
drwxrwsr-x    2 mstr     staff           256 Sep 20 10:20 Logs
-rw-rw-r--    1 mstr     staff           197 Sep 20 10:20 Properties.xml
drwxrwsr-x    2 mstr     staff           256 Sep 20 10:20 VPWA1432
drwxrwsr-x    2 mstr     staff           256 Sep 20 10:17 tmp

How would I go about getting a file from my PC onto that server and replacing it with a new Logging.xml file? Some kind of ftp? Smilie
# 2  
Old 12-21-2011
You can try this SCP client: WinSCP :: Download
# 3  
Old 12-21-2011
I was actually hopping I could do this without any special software in order to get a better grasp of the entire process.


So I have found how to ftp it over from my hard drive. With put command



Code:
lets FTP a file called my_file from c:\temp to /temp/files.
note: you would use the put command to ftp the file, and the put command allows to change the file name on the fly. So, in my example I'm changing the file name from my_file to test_ftp.txt
 
 
ftp> put my_file.txt test_ftp.txt
200 PORT command successful.
150 Opening data connection for test_ftp.txt.
226 Transfer complete.
ftp: 5151 bytes sent in 0.01Seconds 515.10Kbytes/sec.
ftp> bye
221 Goodbye.
 
C:\temp>



So using the above example it shows me how to put my Logging.xml file into the directory. Is there a way to replace the current Logging.xml file easily. Would I have to put the Logging.xml in the directory first then replace or delete the other one....or could I replace it on the fly with the put command? Smilie
# 4  
Old 12-21-2011
If this is a proper text file be sure to use "ascii" mode for the ftp (just issue the command "ascii" before the "put" command). This is because Microsoft text file format is different from unix text file format.

We know nothing about the permissions of your account. If you are user "mstr" in group "staff" you can change your own files. The "ftp" process will prompt you if you are about to overwrite a file.
It is best practice to copy any file before changing that file. In this case renaming the target file before replacing that file would be prudent. Be sure to correct any permissions afterwards.
This User Gave Thanks to methyl For This Post:
# 5  
Old 12-22-2011
Quote:
Originally Posted by methyl
If this is a proper text file be sure to use "ascii" mode for the ftp (just issue the command "ascii" before the "put" command). This is because Microsoft text file format is different from unix text file format.
Interesting. Im pretty sure it doesn't need to be modifed(Im not sure). I didn't create the .xml on my machine. Its the same xml file thats currently in Unix but it was modified a little bit by support from MicroStrategy.


Quote:
We know nothing about the permissions of your account. If you are user "mstr" in group "staff" you can change your own files.
I have to apologize since im a moron with Unix. This is the directory that shows when I log in; spkupa401/usr/home/mstr) I then did a "who" command and the it shows "mstr" and "root". So I assume that I have to be "mstr" Smilie

spkupa401(/WebSphere) $who
root lft0 Jul 26 13:09
mstr pts/1 Dec 22 09:03 (qsd082265.vcdev.vc.net)



So if thats the case then yes I have full premissions for the WebSphere directory;

spkupa401(/) $ls -l
total 3488
drwxr-xr-x 11 mstr staff 4096 Oct 06 16:10 WebSphere





Quote:
The "ftp" process will prompt you if you are about to overwrite a file.
It is best practice to copy any file before changing that file. In this case renaming the target file before replacing that file would be prudent. Be sure to correct any permissions afterwards
Yes im glad you brought that this up. This is because also I actually don't want to keep the new file in there. Just a quick background the .xml file im moving in there is modified to allow a trace. The current .xml in there doesn't have the trace turned on. So I guess it would actually make more sense to just rename the Logging.xml file like you said in the directory
# 6  
Old 12-23-2011
methyl is right ....

U should know as this is the ascii file or binary file...

i think u should not delete the old file .. just rename that ..and put the new file in unix server.

ftp IP
username
passwd
cd unix path
bin
put new file


or u can use window based (SSH Secure Shell) .. just drag n drop.
This User Gave Thanks to meetsubhas For This Post:
# 7  
Old 12-23-2011
Im not sure if its ascii file or binary file. I did ask support who i recieved it from. I read if it opens fine in notepad there is a good chance its ascii file? Smilie

Quote:
Originally Posted by meetsubhas
ftp IP
username
passwd
cd unix path
bin
put new file


Just curious...what do you mean by bin?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Has anyone created JFS2 file system on a USB drive attached to AIX server?

We have an IBM Power 710. It has a USB port on the front. I have done some searching and see that there is information out there on how to create a JFS2 file system on USB drives. A few have commented that they would not recommend it, if the server is important, may crash the server... Just... (0 Replies)
Discussion started by: mbenedi
0 Replies

2. UNIX for Dummies Questions & Answers

Need help to move .csv file from UNIX path to windows shared drive or c:\ drive

Hi Guys, Can any one help me on this. I need help to move .csv/.xls file from unix path to windows shared drive or c:\ drive? Regards, LKR (1 Reply)
Discussion started by: lakshmanraok117
1 Replies

3. Shell Programming and Scripting

Need help to move .csv file from UNIX path to window c: shared drive

Hi Guys, I need to move myfile.csv file from unix path(\oracle_home) to window c:\ shared drive h:\. Thanks in advance! Regards, Lakshman (1 Reply)
Discussion started by: lakshmanraok117
1 Replies

4. Windows & DOS: Issues & Discussions

Script that, if file exists in Samba share, moves file to Unix server

I'm looking to do pretty much what the title says. I want a script that runs, it can run on Unix or Windows, doesn't matter, and searches a Samba shares for a .txt file. If the file exists, the script will move (or possibly copy) the file from the Samba share into a directory on our Unix... (3 Replies)
Discussion started by: twcostello
3 Replies

5. SCO

Sco unix 5.0 copy file to pen drive

I have a server unix Sco 5.0 and copy some backup files to flopy drive using command "Tar", but i like copy this files to pen drive, is possible ? my know about Sco is less. Tks (1 Reply)
Discussion started by: ger2112
1 Replies

6. UNIX for Dummies Questions & Answers

Copy a windows CVS file to the unix server as a svs file

I so desperately need a script to copy a windows csv file to my unix server and i know these should be at dummies but i have no bits. it is life & no job situation help please. thanks (1 Reply)
Discussion started by: zhegal
1 Replies

7. UNIX for Dummies Questions & Answers

To copy a file from one unix server to another unix server through scripts

I am getting the fallowing error when i am trying to execute the scp commomd in shell script warning: You have no controlling tty. Cannot read confirmation. warning: Authentication failed. Disconnected; key exchange or algorithm negotiation failed (Key exchange failed.). scp2: warning: ssh2... (1 Reply)
Discussion started by: manit
1 Replies

8. Shell Programming and Scripting

file monitoring using unix scripting on shared drive

Hi all, I have a query and need advise. is it possible to have a script which will monitor file/s on network shared drive (windows machine)? Is there a way i can monitor a file is available on shared drive and move it over to unix machine for further processing? Any guidance or advice much... (3 Replies)
Discussion started by: zulfikarmd
3 Replies

9. Shell Programming and Scripting

Deleting a file in Windows drive from Unix script

Objective ******* I was trying to develop a script that moves files from one folder to another in Windows drive from a Unix script. I got ftp account created for those windows folders. I know that for moving a file from Unix server to Windows server we use scp command, but is there a command... (2 Replies)
Discussion started by: anilvaranasi_02
2 Replies

10. Shell Programming and Scripting

ftp from hard drive to unix server

i want to ftp a flat file from my local harddrive to the unix server box. Can anybody send me the command. Thanks (6 Replies)
Discussion started by: dummy_needhelp
6 Replies
Login or Register to Ask a Question