Find the answer to your Linux question:
Results 1 to 9 of 9
Is there an easy way to find out when I last sync'ed with the gentoo mirrors?? I've just set up a cron job to emerge --sync , and I'd like ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414

    When did I last emerge --sync ?? [SOLVED]


    Is there an easy way to find out when I last sync'ed with the gentoo mirrors?? I've just set up a cron job to emerge --sync, and I'd like to be sure that it actually worked.

    Thanks.
    Registered Linux user #388328 || Registered LFS user #15880
    AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  2. #2
    Linux Engineer d38dm8nw81k1ng's Avatar
    Join Date
    Mar 2005
    Location
    Newcastle
    Posts
    793
    this isn't exactly what you wanted but you can ask someone who has already done an emerge sync to check a couple of packages that have been updated since the previous sync against yours.
    Here's why Linux is easier than Windows:
    Package Managers! Apt-Get and Portage (among others) allow users to install programs MUCH easier than Windows can.
    Hardware Drivers. In SuSE, ALL the hardware is detected and installed automatically! How is this harder than Windows' constant disc changing and rebooting?

  3. #3
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    You could check if /var/tmp/portage has been modified since last timeyou synced.
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    All emerge calls are logged in /var/log/emerge.log. You might check through there for your last sync.

  6. #5
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414
    Quote Originally Posted by Cabhan
    All emerge calls are logged in /var/log/emerge.log. You might check through there for your last sync.
    Thanks for the help guys. This is exactly the file I needed.
    Registered Linux user #388328 || Registered LFS user #15880
    AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  7. #6
    Just Joined!
    Join Date
    Nov 2006
    Location
    Vienna,Austria
    Posts
    4

    bash-script for getting time of last portage-tree sync

    #!/bin/bash
    cat /var/log/emerge.log|head -$(cat /var/log/emerge.log|grep -n "Sync completed"|cut -d ":" -f1)|grep -e "Started emerge"|tail -1|cut -d " " -f5-8

    Gives you Complete Date & Time of last Portage-Tree sync

    Regards,
    Matthias

  8. #7
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624

    Getting error with your script

    Quote Originally Posted by experiment1598
    #!/bin/bash
    cat /var/log/emerge.log|head -$(cat /var/log/emerge.log|grep -n "Sync completed"|cut -d ":" -f1)|grep -e "Started emerge"|tail -1|cut -d " " -f5-8

    Gives you Complete Date & Time of last Portage-Tree sync

    Regards,
    Matthias
    Hi. I tried your script but I get this error....
    Code:
    head: cannot open `2970' for reading: No such file or directory
    head: cannot open `3540' for reading: No such file or directory
    head: cannot open `3770' for reading: No such file or directory
    head: cannot open `3918' for reading: No such file or directory
    head: cannot open `4011' for reading: No such file or directory
    head: cannot open `4835' for reading: No such file or directory
    head: cannot open `5230' for reading: No such file or directory
    head: cannot open `5368' for reading: No such file or directory
    head: cannot open `5639' for reading: No such file or directory
    head: cannot open `7411' for reading: No such file or directory
    i have some idea of what is going wrong but i am unable to find a solution
    See, 2970 ..........etc. are the line numbers where "sync completed" appears. Some how when piped with cat, head does not see them as line numbers but as a file argument. I tried this (change is shown in red)
    Code:
    cat /var/log/emerge.log|head --lines=[-]$(cat /var/log/emerge.log|grep -n "Sync completed"|cut -d ":" -f1)|grep -e "Started emerge"|tail -1|cut -d " " -f5-8
    But then it says
    Code:
    head: [-]5: invalid number of lines
    Do you have any idea why this is happening?
    Thanks
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  9. #8
    Just Joined!
    Join Date
    Nov 2006
    Location
    Vienna,Austria
    Posts
    4
    I tried your Solution and it seems that the "[-]" is the source of the problem.

    cat /var/log/emerge.log|head --lines=$(cat /var/log/emerge.log|grep -n "Sync completed"|cut -d ":" -f1)|grep -e "Started emerge"|tail --lines=1|cut -d " " -f5-8

    The above solution worked for me.

    Matthias

  10. #9
    Just Joined!
    Join Date
    Mar 2007
    Location
    Chennai, INDIA
    Posts
    1

    The most appropriate way

    # cat /usr/portage/metadata/timestamp.chk
    Thu, 22 Mar 2007 19:30:08 +0000

    The right way to do just what is asked, find when you last sync'ed.

Posting Permissions

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