LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-04-2011, 01:15 PM   #1
moyorakkhi
Member
 
Registered: Jan 2011
Location: Dhaka
Posts: 80

Rep: Reputation: 1
AutoMySQLBackup weekly backup modification


Hello,

I'm using AutoMySQLBackup (https://sourceforge.net/projects/automysqlbackup/) script to backup mysql db from several server.I need little help from you who is guru in scripting. I would like to take weekly backup after every 1 week and not every week. i.e. on every 14 days.

This is the weekly backup portion of the script:

Code:
# Weekly Backup
	if [ ${DNOW} = ${DOWEEKLY} ]; then
		${ECHO} Weekly Backup of Database \( ${DB} \)
		${ECHO}
			dbdump "${DB}" "${BACKUPDIR}/weekly/${DB}/${DB}_week.${W}.${DATE}.sql"
			[ $? -eq 0 ] && {
				${ECHO} Rotating 5 weeks Backups...
				${FIND} "${BACKUPDIR}/weekly/${DB}" -mtime +35 -type f -exec ${RM} -v {} \; 
			}
			compression "${BACKUPDIR}/weekly/${DB}/${DB}_week.${W}.${DATE}.sql"
			BACKUPFILES="${BACKUPFILES} ${BACKUPDIR}/weekly/${DB}/${DB}_week.${W}.${DATE}.sql${SUFFIX}"
		${ECHO} ---------------------------------------------------------------------
Kindly help me to modify the script. Thanks for your help in advance.
 
Old 05-04-2011, 01:31 PM   #2
spankbot
Member
 
Registered: Aug 2007
Posts: 133

Rep: Reputation: 16
I would not modify the script. Instead, use cron to only run the script every 14 days.

By default, the automybackup setup instructions tell you to add a simlink in /etc/cron.daily. Instead of doing that, leave the script in a good location (ie, /usr/local/admin/bin) and setup a root cron job to run it every two weeks. Something like so...

Quote:
* * * * 0/2 /usr/local/admin/bin/automysqlbackup
The "0/2" means "every other Sunday".
 
Old 05-04-2011, 01:42 PM   #3
moyorakkhi
Member
 
Registered: Jan 2011
Location: Dhaka
Posts: 80

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by spankbot View Post
I would not modify the script. Instead, use cron to only run the script every 14 days.

By default, the automybackup setup instructions tell you to add a simlink in /etc/cron.daily. Instead of doing that, leave the script in a good location (ie, /usr/local/admin/bin) and setup a root cron job to run it every two weeks. Something like so...



The "0/2" means "every other Sunday".
Hi, thanks for you advice. If I run the script on every 14 days the daily mysql dump will not be taken. This script runs daily and takes daily, weekly and monthly backup with desired rotation. I'd like to run it daily but instead of taking backup on every saturday or sunday or whatever day select, it'll take backup on every 14 days. Thanks again.
 
Old 05-04-2011, 02:07 PM   #4
spankbot
Member
 
Registered: Aug 2007
Posts: 133

Rep: Reputation: 16
So you want daily backups, as well as a bi-weekly backups? I would consider contacting the author.

Last edited by spankbot; 05-04-2011 at 02:08 PM.
 
Old 05-05-2011, 12:06 AM   #5
moyorakkhi
Member
 
Registered: Jan 2011
Location: Dhaka
Posts: 80

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by spankbot View Post
So you want daily backups, as well as a bi-weekly backups? I would consider contacting the author.
I did actually. Haven't got any response
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Modification to Linux cmccullo Linux - Newbie 8 01-22-2011 02:08 PM
LXer: Creating MySQL Backups With AutoMySQLBackup On Ubuntu 9.10 LXer Syndicated Linux News 0 02-19-2010 10:41 PM
Better if user name modification is available. raju.mopidevi LQ Suggestions & Feedback 3 12-16-2009 09:13 AM
Doin a weekly tape backup - multiple questions - VERY important - Please help WorldBuilder Linux - General 10 04-25-2003 03:12 PM
Weekly tape backup WorldBuilder Linux - General 10 03-30-2003 05:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration