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 am trying to write a script that redirects the date and time when eth0 comes up. Here's the line with problem

up date '+UPTD %d-%m-%y/%H:%M' >> /home/abpit/network.log

But it doesn't write a single thing in the file! What am I doing wrong?

ubuntu version: 12.04 File has now RWX permission, but still it doesn't have a single line in it. Also, eth0 is configured automatically .

share|improve this question
You should add more info, like the file where you have put that line and your Ubuntu version/architecture. Also check the file has execution permission. – Salem Dec 12 '12 at 18:14

If you have an encrypted home directory and eth0 is brought up before you log in (as it generally is if it is marked "auto") then the network.log file will be written under a directory which later is used as a mount point for your encrypted-home filesystem, rendering the file inaccessible. Don't write the date to a file in your home directory; use /var/log/.

share|improve this answer

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.