LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using Shell Script crontab backup and delete with schedule (https://www.linuxquestions.org/questions/linux-newbie-8/using-shell-script-crontab-backup-and-delete-with-schedule-764701/)

chamreth 10-26-2009 11:43 PM

Using Shell Script crontab backup and delete with schedule
 
Dear,

I have a problem need help, I want to do a schedule with using shell script with crontab in linux SuSE SLES 10.
The problem as below:

1. I have many server that want to do backup mysql all from that server everyday. I need advice for for write shell script to backup all mysql in different server to server backup everyday and create auto folder as date example 27102009, 28102009..........for a month will has 30 folder in server backup.
2. Also need to write shell script to delete all folder but keep only one week last example from 1 to 30 it will has 30 folder in sever backup but i want to keep only 7 folder last and want to set schedule delete it every saturday night.
3. used that shell script with crontab in linux.

Any one has an idea pls advice me or sent me a mail If all above not clear can ask me for detail than this.


Thanks in advance!!

chrism01 10-27-2009 12:34 AM

1. show us what you've tried so far. Try these for shell coding:
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

See also
http://dev.mysql.com/doc/refman/5.0/...-recovery.html
http://linux.die.net/man/1/rsync

2. don't post your email, we do our talking here, so all can see & benefit.
In addition, a spambot could come along and grab it and you'll be sorry.

linuxlover.chaitanya 10-27-2009 01:26 AM

You could also use this tool for backing up your databases. See Here

chrism01 10-27-2009 07:47 PM

Also, if you have a lot of servers, look at http://www.amanda.org/

chamreth 10-27-2009 10:43 PM

Could you give me a specific than this?
becas i young on using linux so i can't catch your point.

Regards,

Quote:

Originally Posted by chrism01 (Post 3733702)
1. show us what you've tried so far. Try these for shell coding:
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

See also
http://dev.mysql.com/doc/refman/5.0/...-recovery.html
http://linux.die.net/man/1/rsync

2. don't post your email, we do our talking here, so all can see & benefit.
In addition, a spambot could come along and grab it and you'll be sorry.


chrism01 10-27-2009 11:10 PM

Try reading them, write some code and come back if you get stuck.

linuxlover.chaitanya 10-28-2009 12:10 AM

Quote:

Originally Posted by chamreth (Post 3734836)
Could you give me a specific than this?
becas i young on using linux so i can't catch your point.

Regards,

Have you gone through the my post#3? Its just a tool that you can configure with little knowledge of Linux. But some effort from your side is still needed.

choogendyk 10-28-2009 06:59 AM

Keyword: mysql. If your primary concern is backing up your MySQL databases, then ChrisM01 already gave you a link to the Backup and Recovery documentation at mysql.org, and Chaitanya already gave you a reference to phpMyBackupPro. I would also look at Zmanda Recovery Manager (ZRM) for MySQL. Both of those are open source. You can install them on your system and configure them to back up your MySQL databases according to your own choice of schedule.

You should also have a regular backup routine aside from MySQL. If you use ZRM, that will end up with disk based files that you could use to recover your databases. You can then use something like Amanda (already mentioned by ChrisM01) to back that up along with the rest of your system -- to tape, to virtual tapes, to off site systems (cloud backup), etc.

You can play with scripting these sorts of things yourself, and that can be a good learning process, but you will quickly grow out of that. There are just lots of open source projects out there that will do these things for you. They will take into account a lot more detail than you can manage to script for yourself.


All times are GMT -5. The time now is 12:13 AM.