Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer
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 '12 at 8:48

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.

share|improve this answer
Ok, thanks cloyd800 and also @Ruediger.. I'll create a new directory within /var/ for this. – Albert Apr 19 '12 at 6:51

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

share|improve this answer
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 '12 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 '12 at 8:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.