Server Fault is a question and answer site for system and network administrators. 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 have a script that runs backup of system files via tar as a cronjob for my server. Every time the script is being fired off, it completed the task as successful. All backups were tested and appeared to be working and not corrupted.

But, my system stalls and froze for a while and it lags my commands as slow. It is same condition as when I ran graphic desktop. So, why does system stall after tar run?

This is command in my script on crontab for tar backup run.

tar -zcvf tarbackup.tar.gz --one-file-system \
--exclude=/run \
--exclude=/tmp \
--exclude=/home \
--exclude=*.system.tar.gz \
--exclude=*.home.tar.gz \


To solve that issue, I had to reboot every time. I wish to understand why it happens, so I can explore the option of running tar backup without having to reboot the system.

share|improve this question
up vote 1 down vote accepted

The stall occurs while dirty pages are being written to disk; you can get a quick introduction to the problem at this LWN article. Basically, the current default for the amount of memory used to cache writes is way too high. Try setting */proc/sys/vm/dirty_background_bytes* to 104857600 and */proc/sys/vm/dirty_bytes* to 209715200. You can do this for the current boot by running sysctl or permanently by editing /etc/sysctl.conf.

share|improve this answer
Accepted this as an answer for explanation to reason why system stalls. – Faron Jan 4 '14 at 23:53

This answer functions in a way which avoids you having to manipulate the dirty_bytes/dirty_background_bytes system global which may affect other applications when not doing a backup.

Its a bit of a hack to be honest, but I leave it in case its useful to you.

tar -zcv --one-file-system \
--exclude=/run \
--exclude=/tmp \
--exclude=/home \
--exclude=*.system.tar.gz \
--exclude=*.home.tar.gz \
/ | \
dd bs=2048k oflag=sync of=tarbackup.tar.gz
share|improve this answer
Upvoted your answer as it gave me the right command for the function I was looking for. – Faron Jan 4 '14 at 23:53
Worked like a charm! Thanks @matthew-ife! – Faron Jan 5 '14 at 2:02
Preventing other applications from causing the sae problem would be a good thing. :-) – sciurus Jan 5 '14 at 16:24

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.