-   Programming (
-   -   Shell Script for Gzipping with date output (

Junior41180 10-16-2004 06:33 AM

Shell Script for Gzipping with date output
Hi, I got a cron job already set up for doing a mysqldump (Via cPanel), now what i need to do is create a shell script to gzip the DB dump and output the file name to filename-xx-xx-xxxx.sql.gz

Does anyone know if there is a already configured script for this, or does anyone know what the script should be??


Sorry if this is the wrong forum for this. :)

darthtux 10-16-2004 06:39 AM

This is one I wrote a while back. You'll just need to edit it a little.


echo "Enter directory name"
read arg1

DATE=`date +%Y%m%d`
mkdir "$DESTDIR"

cp -r $arg1/* $DESTDIR
tar czvf $DESTDIR.tar.gz $DESTDIR
rm -rf $DESTDIR

All times are GMT -5. The time now is 02:24 PM.