Bug 205755

Summary: portsnap(8) suggestion: add option that shows last time a snapshot was fetched
Product: Base System Reporter: bkazemi
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Only Me    
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description bkazemi 2015-12-31 12:52:47 UTC
Hello,

I have a small script I use to check how long it's been since I've grabbed a snapshot of the ports tree. I figured others might also like being able to get this information via a flag in portsnap.

Here is how I implemented this:
datethen=`cut -f2 -d\| /var/db/portsnap/tag 2>/dev/null`
: ${datethen:?'no tag'}
datenow=`date +%s`
datediff=`expr $datenow - $datethen`
date -r $datethen
echo "$((datediff / 86400)) day(s) $((datediff / 3600 % 24))"\
     "hour(s) since sync."