• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

compress files

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?
0
XK8ER
Asked:
XK8ER
  • 2
1 Solution
 
woolmilkporcCommented:
Hi,

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.

wmp


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

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now