Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29

Thread: mysql backup

  1. #21

    Re:mysql backup

    Considering the fact that shell script will be containing user credentials I think it is a good idea to put it in /usr/sbin - I think inly those with id 0 have access to this directory, right?
    Thanks.

  2. #22

    Re:mysql backup

    [quote author=elovkoff link=board=4;threadid=9557;start=0#msg87422 date=1091210036]
    Considering the fact that shell script will be containing user credentials I think it is a good idea to put it in /usr/sbin - I think inly those with id 0 have access to this directory, right?
    Thanks.
    [/quote]
    I'm not sure about that. I can look inisde sbin as I user (I think I can't execute...)

    However, that 's not a problem. do a

    Code:
    chown myuser shellscript.sh
    Code:
    chmod 700 shellscript.sh
    That way, only myuser can read, write or execute that file.
    Then make sure is that user's cron that runs it.

  3. #23

    Re:mysql backup

    Thanks everybody.

  4. #24

    Re:mysql backup

    Well..... I've been a lurking member long enough. So here is my first post.

    Here is the backup script I use for my mysql databases.

    Code:
    
    ----- Begin mysql_backup.sh --------------------------------------------
    
    #!/bin/sh 
    for i in `mysql -B -e "show databases" | tail +2`; do
    mysqldump --opt $i | gzip -9 > /var/backups/mysql/$i.`date --iso-8601`.gz
    ls -t /var/backups/mysql/$i.* | tail +7 | xargs rm -f
    done
    
    ---- End Script -----------------------------------------------------------
    This script keeps 8 days worth of compressed mysql backups in /var/backups/mysql . You can easily edit the script to change the number of days of backups you keep. I automate this in a cron job that runs nightly. Works great

  5. #25

    Re:mysql backup

    That's a nifty script you got goin' on +1 karma.

  6. #26

    Re:mysql backup

    Woot......

    Although I have NO idea what +1 karma means ??? Thanks.


  7. #27

    Re:mysql backup

    Dummy question - how do I adjust the number of days in that script?

  8. #28

    Re:mysql backup

    Change the tail +7 to tail+WHATEVER

    That should do it.


  9. #29

    Re:mysql backup

    Thanks.

    Karma it's a little number under your user icon which indicates that otehr users appreciated your replies

Similar Threads

  1. MySQL Backup and Reanimation
    By Ashcrow in forum Linux - General Topics
    Replies: 3
    Last Post: 04-26-2011, 12:07 AM
  2. Automatic MySQL Backup Script
    By peter in forum Tutorials
    Replies: 1
    Last Post: 09-22-2009, 09:13 AM
  3. mysql backup
    By svar in forum Linux - General Topics
    Replies: 2
    Last Post: 01-01-2009, 07:16 AM
  4. Automatic MySQL Backup Script
    By canela in forum Programming
    Replies: 2
    Last Post: 12-20-2006, 04:59 AM
  5. MySQl backup script
    By girlygeek in forum Programming
    Replies: 5
    Last Post: 11-11-2006, 11:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •