I want to keep track of how long a task is running. Thinking it wouldn't take that long, I opted not to run time before it. The fact that it is taking a long time, if I revisit the machine in the morning, what would be the best way to find out what time it ended? In this case, I'm using mt to erase an lto3 tape - sudo mt -f /dev/st0 erase. But I'd like to use the knowledge from this question to track other events, too. I feel like I should know this answer, but cannot think of the solution at the moment. Thanks. Scott
On Fri, Jan 25, 2008 at 07:05:40PM -0500, Scott Ehrlich alleged:> I want to keep track of how long a task is running. Thinking it wouldn't > take that long, I opted not to run time before it. The fact that it is > taking a long time, if I revisit the machine in the morning, what would be > the best way to find out what time it ended?I the terminal where the command is running, type 'date', hit enter, and walk away. At some point, the command will exit and 'date' will execute. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://lists.centos.org/pipermail/centos/attachments/20080125/5c33b922/attachment-0002.sig>
----- "Scott Ehrlich" <scott at MIT.EDU> wrote:> I want to keep track of how long a task is running. Thinking it > wouldn't > take that long, I opted not to run time before it. The fact that it > is > taking a long time, if I revisit the machine in the morning, what > would be > the best way to find out what time it ended? > > In this case, I'm using mt to erase an lto3 tape - sudo mt -f /dev/st0 > > erase. But I'd like to use the knowledge from this question to track > > other events, too. > > I feel like I should know this answer, but cannot think of the > solution at > the moment. > > Thanks. > > Scott > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean.Dunno, maybe you could check for the existance of /proc/$PID every 10 seconds or so from a shell script. And then note when $PID disappeared ? or run strace on the process and write the output to a tmp file. The last update of the logfile should coincide with the process ending. Those are my best shots early on a saturday morning ! Cheers. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
On Jan 25, 2008 7:05 PM, Scott Ehrlich <scott at mit.edu> wrote:> I want to keep track of how long a task is running. Thinking it wouldn't > take that long, I opted not to run time before it. The fact that it is > taking a long time, if I revisit the machine in the morning, what would be > the best way to find out what time it ended? > > In this case, I'm using mt to erase an lto3 tape - sudo mt -f /dev/st0 > erase. But I'd like to use the knowledge from this question to track > other events, too. > > I feel like I should know this answer, but cannot think of the solution at > the moment. > > Thanks. > > Scottjust add 'time' before your command. like this: time sudo mt -f /dev/st0 erase -- -matt