LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-22-2016, 02:18 AM   #1
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Orthodox file locations for backup script and SQL dumps?


Hi,

I'm currently replacing my hand-written backup scripts using rsync over SSH by rsnapshot... and discovering that I had apparently reinvented the wheel, but hey, great learning experience.

Anyway, I installed it on a public root server which is supposed to act as backup server for all my other public servers. I read the rsnapshot documentation, and things are beginning to run nicely.

Two small and technically not very important questions keeps coming back, so I thought today I'm gonna ask.

1. On each one of my public servers, I have a script called sqldump.sh that dumps each single MySQL database, puts a date stamp on it and compresses it. For the moment, it's in /root/bin/. I wonder if that's an orthodox place on the system. Where would you put that script? /opt? /usr/local/sbin?

2. The /root/bin/sqldump.sh script dumps all database backups in the /root/sql directory. This only holds a single days' backups, because once all *sql.gz files get picked up by the remote backup server, they are deleted from /root/sql. Similarly, I wonder if this is an orthodox place. Where would you guys put these?

Cheers,

Niki

Last edited by kikinovak; 12-22-2016 at 02:23 AM.
 
Old 12-22-2016, 07:10 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,522

Rep: Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944
Quote:
Originally Posted by kikinovak View Post
Hi,
I'm currently replacing my hand-written backup scripts using rsync over SSH by rsnapshot... and discovering that I had apparently reinvented the wheel, but hey, great learning experience.

Anyway, I installed it on a public root server which is supposed to act as backup server for all my other public servers. I read the rsnapshot documentation, and things are beginning to run nicely.

Two small and technically not very important questions keeps coming back, so I thought today I'm gonna ask.

1. On each one of my public servers, I have a script called sqldump.sh that dumps each single MySQL database, puts a date stamp on it and compresses it. For the moment, it's in /root/bin/. I wonder if that's an orthodox place on the system. Where would you put that script? /opt? /usr/local/sbin?
Short answer: it's your server..put things wherever you want them.
Longer answer: keeping things separate and in logical places (such as having a /backup folder?) is a good thing. Storing files (especially backups and the like) in the ROOT directory is a bad idea. Some utilities won't run as root, so trying to point them to the /root folder to use a file is a no-win situation.
Quote:
2. The /root/bin/sqldump.sh script dumps all database backups in the /root/sql directory. This only holds a single days' backups, because once all *sql.gz files get picked up by the remote backup server, they are deleted from /root/sql. Similarly, I wonder if this is an orthodox place. Where would you guys put these?
Again, your server, your rules. I would NEVER store anything on /root, period.
 
1 members found this post helpful.
Old 12-22-2016, 08:21 AM   #3
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Thanks for the clarification. After some thinking and fiddling, I put the sqldump.sh script in /usr/local/sbin (which seemed a sensible location) and dumped the SQL backups in /sqldump (because why not).

Cheers,

Niki
 
Old 12-22-2016, 11:44 AM   #4
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
Another small suggest from my side...

You may decide to store your backups in a dedicated partition (mounted for example under /sqldump).

Doing that in the root partition could be a bit dangerous for your system if you run out of the space.

I hope this helps!

Last edited by gda; 12-22-2016 at 11:46 AM.
 
1 members found this post helpful.
Old 12-22-2016, 11:58 AM   #5
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by gda View Post
Another small suggest from my side...

You may decide to store your backups in a dedicated partition (mounted for example under /sqldump).

Doing that in the root partition could be a bit dangerous for your system if you run out of the space.

I hope this helps!
Too late for that. This being said, there's no risk of running out of space. The "target" machines are four public servers in a datacenter 800 km from here that are generously dimensioned for their various tasks. As are the two backup servers which are only doing that: backups.

Last edited by kikinovak; 12-22-2016 at 12:01 PM.
 
Old 12-22-2016, 12:04 PM   #6
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
Quote:
Originally Posted by kikinovak View Post
These are all public servers in a datacenter 800 kilometers from me. And the two backup machines are only doing that: backups.
Sorry. I missed that. I understood you had the full control on the backup servers...
 
Old 12-22-2016, 01:33 PM   #7
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by gda View Post
Sorry. I missed that. I understood you had the full control on the backup servers...
On a side note: Rsnapshot is a really great piece of software.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Sourcing a sql file in a bash script throws errors sysmicuser Linux - Newbie 9 11-21-2016 07:34 AM
SQL and Root File backup to FTP thedjtrollin Linux - General 8 04-18-2013 12:03 AM
LXer: 10 Best Orthodox Free Linux File Managers LXer Syndicated Linux News 0 06-01-2012 01:11 AM
file managers: orthodox vs explorer cmd16 Linux - Software 5 12-26-2011 02:25 PM
using sql dumps for demos poeta_boy Programming 4 08-31-2005 11:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:01 AM.

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