Welcome to Geeklog, Anonymous Thursday, September 19 2024 @ 12:43 pm EDT

Geeklog Forums

Auto backup via Unix Cron


Auspexian

Anonymous
Hi all,

anyone has a script for automatically backup both the geeklog directory and the database to a local file? then maybe ftp it to another site?

I found a ftp backup script that can be modify. to backup the geeklog and public_html directories.

What is the full command line to backup via mysqldump the database to a file?

I can insert it into the script and have it ftp all to a remote site nightly via crontab.

thank you

John
 Quote

Status: offline

ByteEnable

Forum User
Full Member
Registered: 10/20/03
Posts: 138
Here is a script I use from a cron job. It backs up my whole site, including database, nightly.

Text Formatted Code

#! /bin/sh
# This script backs up LinuxElectrons code, plus MySQL database

rm -f geeklog/backups/*.sql
cur_date=`date +%a-%d%m%y`
mysqldump -hhostname -uuser -ppassword --opt dbname > geeklog/backups/geeklog.$cur_date.sql
tar zcvf le-backup.$cur_date.tar.gz www

 
 Quote

auspexian

Anonymous
Cool. Thanks so much.
 Quote

All times are EDT. The time is now 12:43 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content