Orthodox file locations for backup script and SQL dumps?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.