Results 1 to 9 of 9

Thread: Utility to log Ubuntu/Windows usage

  1. #1
    Join Date
    Aug 2007
    Location
    Stroud, UK
    Beans
    148
    Distro
    Ubuntu Development Release

    Utility to log Ubuntu/Windows usage

    I've had a brief search, and as far as I know there isn't something for this, but I thought I'd ask you lot here just in case.

    Basically, I'd like to know how often I select Ubuntu/Windows to log in to from my GRUB menu. I'm not really bothered how the data is represented, but I thought it'd be interesting to find out just how much I use Windows nowadays. Presumably it's fairly easy to implement, and I'm sure I could write something to do it myself, but I thought I'd see if others have seen anything like this first.

  2. #2
    Join Date
    Oct 2008
    Location
    New Jersey
    Beans
    515
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Utility to log Ubuntu/Windows usage

    Not exactly a techincal fix, but a post-it and a pen would work

    In all seriousness though, there probably isn't a solution. GRUB resides in a very small section of your HDD called the MBR (master boot record), and I don't think it has the capability to write to one of your partitions.
    OH NOES!!! I HAZ CRASHED SERVER!! WHY ON EARTH WOULD YOU DO THAT?!?! CAUSE ITS FUNNY!!!!
    Running either 7.04, 8.04, 8.10, 9.04, it varies.
    You talkin' to me? - Taxi Driver (1976)

  3. #3
    Join Date
    Jun 2007
    Location
    Paraparaumu, New Zealand
    Beans
    Hidden!

    Re: Utility to log Ubuntu/Windows usage

    I'd envisage a small script or program that gets called from each of the OSes and that writes a log entry to a place that's accessible from your reporting system. It would be something that the each OS takes care of rather than from within grub.

    Link and/or volunteer to write the program needed.....
    Forum DOs and DON'Ts
    Please use CODE tags
    Including your email address in a post is not recommended
    My Blog

  4. #4
    Join Date
    Oct 2008
    Location
    New Jersey
    Beans
    515
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Utility to log Ubuntu/Windows usage

    Quote Originally Posted by lisati View Post
    I'd envisage a small script or program that gets called from each of the OSes and that writes a log entry to a place that's accessible from your reporting system. It would be something that the each OS takes care of rather than from within grub.

    Link and/or volunteer to write the program needed.....
    For linux, you could add these lines to /etc/rc.local, a script that runs once per boot, I use it in my server to mount my floppy disk (that for some reason doesnt mount on boot?)

    Code:
    echo Ubuntu Loaded at: >> /public/directory/here
    date >> /public/directory/here
    that would insert the time ubuntu booted to whatever file you want
    OH NOES!!! I HAZ CRASHED SERVER!! WHY ON EARTH WOULD YOU DO THAT?!?! CAUSE ITS FUNNY!!!!
    Running either 7.04, 8.04, 8.10, 9.04, it varies.
    You talkin' to me? - Taxi Driver (1976)

  5. #5
    Join Date
    Aug 2007
    Location
    Stroud, UK
    Beans
    148
    Distro
    Ubuntu Development Release

    Re: Utility to log Ubuntu/Windows usage

    Right, after brushing up on my C++ I did it myself! Not a fantastic implementation, but I've got a program running on each at startup which saves the OS and a timestamp to a .csv file in my Dropbox.

    If anyone wants to have a look / try what I've done then I'm more than happy to share

  6. #6
    Join Date
    Oct 2008
    Location
    New Jersey
    Beans
    515
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Utility to log Ubuntu/Windows usage

    impressive, i would have just gone with the post-its

    do you have a program to count them as well?
    OH NOES!!! I HAZ CRASHED SERVER!! WHY ON EARTH WOULD YOU DO THAT?!?! CAUSE ITS FUNNY!!!!
    Running either 7.04, 8.04, 8.10, 9.04, it varies.
    You talkin' to me? - Taxi Driver (1976)

  7. #7
    Join Date
    Aug 2007
    Location
    Stroud, UK
    Beans
    148
    Distro
    Ubuntu Development Release

    Re: Utility to log Ubuntu/Windows usage

    Yeah, but I'm far too good at losing post-its

    It's being output as a .csv file, so atm I'm using Excel/Calc, a column of if statements and a couple of summations to work it out.

  8. #8
    Join Date
    Jul 2010
    Beans
    100
    Distro
    Xubuntu 11.10 Oneiric Ocelot

    Re: Utility to log Ubuntu/Windows usage

    Quote Originally Posted by Nickedynick View Post
    Yeah, but I'm far too good at losing post-its

    It's being output as a .csv file, so atm I'm using Excel/Calc, a column of if statements and a couple of summations to work it out.
    Very smooth. I wouldn't have even thought to use a speadsheet!

  9. #9
    Join Date
    Aug 2007
    Location
    Stroud, UK
    Beans
    148
    Distro
    Ubuntu Development Release

    Re: Utility to log Ubuntu/Windows usage

    Thanks! It's a slightly convoluted setup (I'm sure there's a simpler way), but it seems to work. I just knocked up an import function into a separate .ods file, so I don't need to touch the data file any more. At the moment it's Ubuntu 11 - 4 Windows

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •