Sponsored Content
Operating Systems HP-UX Tarring files to remote server Post 303014092 by anaigini45 on Monday 5th of March 2018 06:11:38 AM
Old 03-05-2018
These were the commands I used to accomplish what I wanted :

Code:
#i=`find . \( -name '*.sh' -o -name '*.jar' -o -name '*.gz' \) -exec ls -l {} \+`
# tar cf - "$i" | ssh emoaigin@10.61.1.58 ( cd /root; /usr/contrib/bin/gzip > my.tar.gz )

I get this error :

Quote:
sh: Syntax error: `(' is not expected.
I then change the "(" in the command to "", like this :

Code:
#i=`find . \( -name '*.sh' -o -name '*.jar' -o -name '*.gz' \) -exec ls -l {} \+`
# tar cf - "$i" | ssh emoaigin@10.61.1.58 "cd /root; /usr/contrib/bin/gzip > my.tar.gz"

This time I get prompted for password, but I still get some error :

Code:
# i=`find . \( -name '*.sh' -o -name '*.jar' -o -name '*.gz' \) -exec ls -l {} \+`
# tar cf - "$i" | ssh emoaigin@10.61.1.58 "cd /root; /usr/contrib/bin/gzip > my.tar.gz"
tar: cannot open -rw-------   1 emoaigin   users            0 Mar  5 18:16 ./abc.sh
-rw-------   1 emoaigin   users            0 Mar  5 18:16 ./create.jar
-rw-------   1 emoaigin   users            0 Mar  5 18:16 ./make.gz
Password:
sh: my.tar.gz: Cannot create the specified file.
#

How do I resolve the error?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

backup : files being modified while tarring

I would like to back up several directories weekly using a cronjob. I'm not experienced in UNIX, but I would start like this: tar -cvf backup.tar dir1 dir2 dir3 Now if a file is being modified in the process it will result in an error. How can I prevent this from happening and how can I... (5 Replies)
Discussion started by: jamesbond
5 Replies

2. UNIX for Dummies Questions & Answers

tarring and gzipping dump files

Say I want to transfer several dump files from a Solaris machine onto a Win2k machine for storage. It was suggested that I tar and gzip the dump files before doing so. Is it completely necessary to use both of these utilities, or is it sufficient to compress multiple dump files into one gzip... (4 Replies)
Discussion started by: PSC
4 Replies

3. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies

4. UNIX for Dummies Questions & Answers

tarring large no. of files

dears, I have a folder containing huge no. of files, some of them are created on AUG 16, AUG 17 and AUG 18, for example. All I want to do is tarring all the files created on a certain date, say AUG 18, in one tar file, only in one command line. So, how to feed all the files created on a certain... (4 Replies)
Discussion started by: marwan
4 Replies

5. Shell Programming and Scripting

tarring/compressing files in Unix directory

hi guys, i'm totally new with Unix sripting and no idea how to do the scripting at all. My problem is that my boss asked me to do this: 1.) create a script that will tar or gzip the files in particular directory eg: i'm on my home directory and I need to tar/gzip the file in.. assuming... (1 Reply)
Discussion started by: montski
1 Replies

6. Shell Programming and Scripting

Bash Tarring not un Tarring correctly

HI All, Im encountering behaviour that is not correct for my requirements when I untar a file. Im using the below command to tar up files from various folders to the ARCHIVE folder as below... tar -cvf "$ARCHIVE_PATH"/"$dte_tar_filename" "$LOG_PATH" "$PROCESSED_PATH2" "$ERROR_PATH" ... (5 Replies)
Discussion started by: satnamx
5 Replies

7. UNIX for Dummies Questions & Answers

Tarring files up to four days old

Hi I need help in tarring files up to four days old. I have been doing this: find . -mtime -4|xargs tar -cvf mar4.tar However, it seems like it's tarring everything but leaving those that are 4 days old and newer (which I want tarred and everything else not) ---------- Post updated at... (1 Reply)
Discussion started by: MIA651
1 Replies

8. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

9. 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

10. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies
CLEAN-BINARY-FILES(1)						   User Commands					     CLEAN-BINARY-FILES(1)

NAME
clean-binary-files - remove a third party binaries (JARs) from an upstream archive SYNOPSIS
clean-binary-files {[-f {-, instructions_file}], [-e exclusion_file] [-l]} [-a archive_file] [-d custom_jar_map] [-n] [-p] [-s] OPTIONS
-f The instructions file, specifying which files to keep and which to remove -e The exclusions file, specifying special binary files that are to be preserved, or non-binary files that are to be removed. -l Only list instructions (to put in instructions file), do not delete anything. -a Archive file on which actions will be performed, as opposed to current directory -d A custom jar map file (has priority over the generic one). -n No symlinks (i.e. only clean jars, don't run build-jar-repository afterwards) -p Preserve original file names (-p to build-jar-repository) -s Silent mode. Won't output commands during cleanup -f The instructions file, specifying which files to keep and which to remove -e - The exclusions file, specifying special binary files that are to be preserved, or non-binary files that are to be removed. -l - Only list instructions (to put in instructions file), do not delete anything. -a - Archive file on which actions will be performed, as opposed to current directory -d - A custom jar map file (has priority over the generic one). -n - No symlinks (i.e. only clean jars, don't run build-jar-repository afterwards) -p - Preserve original file names (-p to build-jar-repository) -s - Silent mode. Won't output commands during cleanup EXAMPLES
Suppose there is a vanilla tarball abc-1.tar.gz with some binary files (jars) in it. In the source repo, we would want a clean copy without any jars. We can use the scripts to achieve this: To generate an instructions file: clean-binary-files -e <exclusion file> -l -a abc-1.tar.gz > instructions This creates an 'instructions' file, which contains info on what stays and what goes. Then, one can run: clean-binary-files -f instructions -n -a abc-1.tar.gz This would create abc-1-clean.tar.gz for uploading into jpp/fedora/etc. repositories with no binary (jar) files. Alternatively, if you have a vanilla tarball, you can clean and create symlinks in it's place all at once by: clean-binary-files -e <exclusion file> -d <custom_jar_map> -a abc-1.tar.gz Note: If the -a <file> is not given to clean-binary-files(1), all actions are performed on current directory. SEE ALSO
Regular Manual Pages check-binary-files(1), create-jar-ks(1), jpackage-utils(7) Documentation Further reading should be found in clean-binary-files.txt located in your standard documentation directory. Original mail is here: https://www.zarb.org/pipermail/jpackage-discuss/2005-November/009158.html AUTHOR
Written by Deepak Bhole REPORTING BUGS
Report bugs using JPackage Bugzilla (http://www.jpackage.org/bugzilla/) clean-binary-files (jpackage-utils) 1.7.5 February 2009 CLEAN-BINARY-FILES(1)
All times are GMT -4. The time now is 10:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy