compress files

Posted on 2009-05-02
Last Modified: 2012-05-06
hello there,
I have 5 files in /backup/sql
I would like to create a little script that can do inside the dir and compress these files
so that I put it to run at crongjob.. how can I do that?
Question by:XK8ER
    LVL 68

    Accepted Solution


    to compress ALL files inside the dir, simply do 'gzip /backup/sql/*'

    For cron:

    * * * * * /path/to/gzip /backup/sql/*

    To compress only selected files, we need a common characteristic, please tell us if you need to select files.


    LVL 68

    Expert Comment

    /path/to/gzip is most probably '/bin/gzip' or '/usr/bin/gzip'
    Enter 'which gzip' to find out.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now