scp and uncompress on the file?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers scp and uncompress on the file?
# 1  
Old 12-18-2014
scp and uncompress on the file?

Hi,

Is there any way to do scp and uncompress on the fly? At the moment, I am doing scp and then running uncompress of the .Z files in the background.

I am wanting to be able to do scp and then have the uncompress the .Z file in the background.

Any advice much appreciated. Thanks in advance.
# 2  
Old 12-18-2014
You could use ssh instead of scp and pipe its output through the uncompress command.
# 3  
Old 12-18-2014
You could decompress it locally(in a pipe, no need to waste disk space) and pass it into scp with -C, to compress on the connection itself to save bandwidth.

Code:
uncompress -c < inputfile | scp -C /dev/stdin username@host:/path/to/destination/filename

# 4  
Old 12-18-2014
Quote:
Originally Posted by RudiC
You could use ssh instead of scp and pipe its output through the uncompress command.
If you do that, make sure you use the "-e none" ssh option to disable escape characters. If you don't, and your data contains any escape sequences, results are undefined...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Uncompress and ftp a file

i have a compressed file, i need to ftp this file to remote server. while ftp i should uncompress and send, but the uncompressed file shouldn't write in the local server file system. is there any options how to do this using a named pipes in ftp?? greatly appreciate your suggestions? Thanmks (2 Replies)
Discussion started by: Fakru.y
2 Replies

2. Shell Programming and Scripting

scp one file after another

Hi, I am looking to scp two files in one go, where the second file is sent only if the first one has been fully copied across. I know of the following command that is used to copy multiple files across to one destination server: cp file1.log file2.log user@servername:~/upload Will this... (3 Replies)
Discussion started by: brunlea
3 Replies

3. Shell Programming and Scripting

Avoiding file overwrite during file transfer using scp

Hi, I have written a small script to transfer a file from one unix server to other using scp command which is working fine. As I know with scp, if any file with the same name is already present on destination server, it would get overwritten without any notification to user. Could anyone help me... (14 Replies)
Discussion started by: dsa
14 Replies

4. Programming

Uncompress a gzip and bzip file using java on unix solaris environment

Hi, I need to uncompress a gzip and bzip file using java on unix solaris environment. I also need to retreive the header information of the file inorder to differentiate between gzip and bzip file. Please help Pooja (0 Replies)
Discussion started by: wadhwa.pooja
0 Replies

5. Shell Programming and Scripting

uncompress a file and ftp

Hi Experts, Here is my piece of code-- #!/usr/bin/perl use Net::FTP; #use IO::Uncompress::Unzip qw(unzip $UnzipError) ; use IO::File ; print "Retrieving file from abc.com...\n"; $loginip='123.456.0.23'; $loginid='nt1234'; $loginpaswd='defgsljf';... (6 Replies)
Discussion started by: namishtiwari
6 Replies

6. UNIX Desktop Questions & Answers

file zip,rar,tar,compress,uncompress,unzip,unrar

i want know how to compress and uncompress file using unix, compress uncompress,zip,unzip,rar,unrar,how its work and more about this.:confused: (1 Reply)
Discussion started by: ismael xavier
1 Replies

7. UNIX for Advanced & Expert Users

uncompress

Hi All, is it possible to uncompress on another directory ? At the moment I have my file to uncompress on /u07 that has 5GB free. When uncompressed it would be more then 6G , I want to send uncompressed file on another directory where I have more free space. is it possible ? How ? Many thanks... (3 Replies)
Discussion started by: big123456
3 Replies

8. UNIX for Dummies Questions & Answers

How to get to a file and uncompress it

I did an ftp to copy a tar file from a main server area to the backup server area. I need to get that tar file to uncompress it in backup server. How do I go about it. Please any suggesstion will be greatly appreciated (1 Reply)
Discussion started by: nkem22
1 Replies

9. UNIX for Dummies Questions & Answers

Uncompress... me!!!!!! :)

Dear friends, i'm trying to uncompress an "...... tar.z" file. I'd readen that using the "uncompress" command it could be made but............... God! I can't!!!!! I tried a lot of times using the Terminal but the uncompress command doesn't obeys!!! :):) . Please i need to know how to... (3 Replies)
Discussion started by: gussiglo21
3 Replies

10. UNIX for Dummies Questions & Answers

How to uncompress .zip file?

Hi all, Can anyone tell me what tools / command can use to uncompress those *.zip file in HP-UX, thx. Bgds, Gordon (7 Replies)
Discussion started by: fonggo
7 Replies
Login or Register to Ask a Question