[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: moving and compressing on the fly



On Wed, 2005-02-23 at 16:46 +0100, Bob Alexander wrote:
> I do not quite manage to find the proper catenation of commands to mv or 
> cp a file and compress it (preferably with bzip2) on the fly.
> 
> Suppose I want to backup my /etc/X11/XF86Config4 file to 
> /home/bob/configs as XF86Config.bz2

I think tar would suit you better.

For example, here's what I do:
# cd /
# tar cvphsfj ${dest}/bkup_${y}_${x}-misc.tar.bz2 \
        var/spool/cron/crontabs/    \
        etc/hosts   \
        etc/hostname    \
        etc/sudoers \
        etc/default \
        etc/gpm.conf    \
        etc/exports \
        etc/lilo.conf   \
        etc/fstab   \
        etc/modules \
        etc/X11/XF86Config-4   \
        etc/postfix/main.cf     \
        etc/postfix/master.cf   \
        etc/spamassassin/local.cf \
        /etc/udev/rules.d/10-local.rules \
        etc/cups/cupsd.conf


-- 
-----------------------------------------------------------------
Ron Johnson, Jr.
Jefferson, LA USA
PGP Key ID 8834C06B I prefer encrypted mail.

"World peace, like community peace, does not require that each
man love his neighbor -- it requires only that they live together
with mutual tolerance, submitting their disputes to a just and
peaceful settlement."
John F Kennedy



Reply to: