3

I need to backup regularly (daily, using cron) some folders along with MySQL database contents (in sql format). Is it okay to use /var/log (by creating a new folder to be used in it) for storing these backup files? In longer interval the contents of that folder will be backed up in external media.

Thanks in advance.

3 Answers 3

4

There is no such thing as a Linux/Unix police force, arresting people for doing sysmtems management in an unwise manner. Sometimes that is a pitty, it would save a lot of work.

So the answer to your question is: Yes you can, but you shouldn't. Nobody will be looking for backup files in /var/log and therefore the backups are a waste of time/effort.

Create a directory like /var/mysql_backups and change the backup script to include this directory.

Do a daily check if backups succeeded.

Don't forget to do a recovery test once the backup has been running for a few days and repeat it every (half) year.

1
  • No, this is not about Linux/Unix police force :) I just want to avoid auto-writing/auto-removing/auto-something by system on my folder under /var or /var/log. Yes, I definitely will create my own directory under /var. Thanks..
    – Albert
    Apr 19, 2012 at 8:48
3

It'd probably be better if you created your own directory within /var/ for these SQL backups to go to. It will be easier for you in the long run to organize and view this data, and depending on the Cron jobs you'll be running - you wouldn't want it to interfere with any logs or backups for the actual system itself.

1
  • Ok, thanks cloyd800 and also @Ruediger.. I'll create a new directory within /var/ for this.
    – Albert
    Apr 19, 2012 at 6:51
0

Why don't you create a /var/backup folder or something like that? In /var/log there should only be logfiles.

2
  • There is /var/backups (yes, with 's') folder by default (I use Ubuntu 11.10), but I'm unsure what it's for and which apps are using it (it's empty now). Is it okay to use it? Or, is it better creating a custom folder in /var (such as /var/backup)?
    – Albert
    Apr 19, 2012 at 6:04
  • I would create a new folder, then you can be sure no other program interferes with your back up procedures.
    – Ruediger
    Apr 19, 2012 at 8:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .