Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7194829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:27:14+00:00 2026-05-28T20:27:14+00:00

I need to backup the MySQL database on my current system. I am using

  • 0

I need to backup the MySQL database on my current system. I am using the mysqldump command in a cron job using a shell script.

Here is roughly what I do:

#!/bin/bash

fileName=$(date +%H-%M)
mysqldump -ubackup -hserver1.local.com -A database1 > /backup/$filename.sql

This take about 1 hour to complete so my question is this:

I need to compress the data so i would like to know if I should first back up the file as pure sql then compress it or should I compress it right away from the mysqldump command?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:27:15+00:00Added an answer on May 28, 2026 at 8:27 pm

    To reduce intermediate disk space usage, you can compress on-the-fly:

    mysqldump (options) | bzip2 -c > /backup/$filename.sql.bz2
    

    This means you won’t have to write out the entire uncompressed SQL data to a file, and then read back over it to compress it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using mysqldump to backup mysql database. Now I just need to use
I need a script that automatically makes a backup of a MySql Database. I
Hi I need to backup MySQL database and then deploy it on another MySQL
I need to backup automatically daily my database in mysql and all image files
I am new to MySQL. I need to take a backup of a database
I'm new to cron jobs and I need to restore a database (mysql) every
I'm doing a webapp and need a backup plan. Here's what I've got so
I need to create a backup of a SQL Server 2005 Database that's only
I need to restore a backup from a production database and then automatically reapply
I'm writing a Python backup script and I need to find the oldest file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.