Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
2  
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

1 Answer 1

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

 
discard

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.