![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to compress .zlib file | wrapster | UNIX for Advanced & Expert Users | 1 | 05-04-2008 11:52 PM |
| unix script to takes the old data from a TXT file and compress them into new file | vpandey | Shell Programming and Scripting | 2 | 03-05-2008 07:10 AM |
| compress more than one file | prasee | UNIX for Advanced & Expert Users | 2 | 09-08-2007 06:15 AM |
| compress a file in unix | rujupriya | UNIX for Dummies Questions & Answers | 5 | 05-24-2006 05:05 AM |
| [help] Cant compress file | endeavour1985 | UNIX for Dummies Questions & Answers | 8 | 01-17-2005 08:37 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Compress a file before ftp
Hi,
I have a script that ftp's to over 100 deifferent servers in turn, gets a specific file, renames it and drops it onto a local backup server. The files vary in size from 4mb to 150mb. I am within a secure intranet to security with ftp is not an issue. I want to auto compress the file before I ftp it over the network, either as a seperate script or as a comand conatained within my original. Can anyone help? the current script is as follows: Code:
hostFile=/data01/global_backup/scripts/GLOBAL_hostFile.txt
while read ip sd
do
echo "connecting to $sd on $ip"
ftp -dv $ip <<EOF
get /global/prd/cycle/export/full_export.dmp /data01/global_backup/files/monday/$sd.full_export.dmp
bye
EOF
if [ $? -ne 0 ]; then
echo "Had a problem connecting to $sd on $ip"
else
echo "Connected to $sd on $ip"
fi
done < ${hostFile}
|
| Forum Sponsor | ||
|
|
|
|||
|
If your system supports remsh, try something like this
Code:
hostFile=/data01/global_backup/scripts/GLOBAL_hostFile.txt
while read ip sd
do
echo "connecting to $sd on $ip"
remsh "$sd" compress /global/prd/cycle/export/full_export.dmp
if [[ $? -ne 0 ]] ; then
echo "error compressing file on $sd"
fi
ftp -dv $ip <<EOF
bin
get /global/prd/cycle/export/full_export.dmp /data01/global_backup/files/monday/$sd.full_export.dmp
bye
EOF
if [ $? -ne 0 ]; then
echo "Had a problem connecting to $sd on $ip"
else
echo "Connected to $sd on $ip"
fi
done < ${hostFile}
|
|||
| Google The UNIX and Linux Forums |