Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

tar with password protect

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 08-26-2005
pradeepmacha pradeepmacha is offline
Registered User
 
Join Date: Mar 2005
Last Activity: 12 May 2014, 3:00 AM EDT
Posts: 35
Thanks: 1
Thanked 0 Times in 0 Posts
tar with password protect

Hello All,
i work with backup, The below script runs and tar the user specified dir and put it in a backup machine. can any one help me to modify this in such a was that the tar file generated can be given a users specific password so that it can have high security.
KINDLY LET ME KNOW IF IT IS NOT CLEAR OR YOU WANT ANYOTHER INFORMATION.

#function to tar the files
tar_it ()
{
#echo "Taring $FILELIST\n"
if [ $TAR_NO -gt 0 ]
then
$TAR rvpf ${BCKDATDIR}${USERNAME}/${TARFILE} $FILELIST 2>&1 | tee -a $TARLOG
TAR_NO=`expr $TAR_NO + 1`
else

OLDTARFILE=`echo $TARFILE |awk -F"_" '{print $1}'`
if [ ! -z "$OLDTARFILE" ]
then
rm -f ${BCKDATDIR}${USERNAME}/*
fi
$TAR cvpf ${BCKDATDIR}${USERNAME}/${TARFILE} $FILELIST 2>&1 | tee -a $TARLOG
TAR_NO=`expr $TAR_NO + 1`
fi
}

...................
HOST_NAME=${LOCAL_MACH}#function to tar the files
tar_it ()
{
#echo "Taring $FILELIST\n"
if [ $TAR_NO -gt 0 ]
then
$TAR rvpf ${BCKDATDIR}${USERNAME}/${TARFILE} $FILELIST 2>&1 | tee -a $TARLOG
TAR_NO=`expr $TAR_NO + 1`
else

OLDTARFILE=`echo $TARFILE |awk -F"_" '{print $1}'`
if [ ! -z "$OLDTARFILE" ]
then
rm -f ${BCKDATDIR}${USERNAME}/*
fi
$TAR cvpf ${BCKDATDIR}${USERNAME}/${TARFILE} $FILELIST 2>&1 | tee -a $TARLOG
TAR_NO=`expr $TAR_NO + 1`
fi
}
Sponsored Links
    #2  
Old Unix and Linux 08-26-2005
andryk's Unix or Linux Image
andryk andryk is offline Forum Advisor  
Registered User
 
Join Date: Sep 2003
Last Activity: 5 June 2008, 4:15 AM EDT
Posts: 448
Thanks: 0
Thanked 1 Time in 1 Post
What about unix crypt ?

Code:
 cat  tarfilename | crypt my_keys > tarfilename.sec  ; # to scramble
 cat  tarfilename.sec  | crypt my_keys > tarfilename ; # to un-scramble

Sponsored Links
    #3  
Old Unix and Linux 08-26-2005
pradeepmacha pradeepmacha is offline
Registered User
 
Join Date: Mar 2005
Last Activity: 12 May 2014, 3:00 AM EDT
Posts: 35
Thanks: 1
Thanked 0 Times in 0 Posts
Hello andryk,
Thanks a lot it helped.

Regards,
Pradeep
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
password protect a CSV file: better solution than ZIP password? slashdotweenie UNIX for Dummies Questions & Answers 12 11-28-2011 10:26 AM
Password protect a zip file Pablo_beezo Shell Programming and Scripting 0 02-15-2010 09:30 AM
Zip and password protect non-interactively savage66 UNIX for Dummies Questions & Answers 1 05-06-2008 09:00 AM
Password protect a file perryl7 UNIX for Dummies Questions & Answers 2 03-30-2005 04:13 PM
Protect a tar file with a password!! geoquest UNIX for Dummies Questions & Answers 1 06-19-2002 08:02 AM



All times are GMT -4. The time now is 03:49 PM.