Get the "Last Modified" date of a Software Channel in CLI

Hi,

For the purpose of reporting I need a way to get the date of when a software repository was last synced.

In the Gui it is shown as “Last Modified”

Can’t find a way to get this information with spacecmd or spacewalk-report commands.

Does anyone have a solution ?

Thanks,

Adam

Hi
The log files for the syncing reside in /var/log/rhn/reposync you can
just check the log date, else you would need to grep each repo file for
the last sync date/time etc.

eg;

ls -la sles12-pool-x86_64.log
-rw-rw---- 1 wwwrun www 373830 Nov 19 02:33 sles12-pool-x86_64.log

tail -n 15 sles12-pool-x86_64.log |grep "Sync started:"
Sync started: Thu Nov 19 02:32:21 2015

perl -e 'print reverse <>' < sles12-pool-x86_64.log |grep "Sync started:"|sed -n 1p
Sync started: Thu Nov 19 02:32:21 2015


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 | GNOME 3.10.1 | 3.12.48-52.27-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Hi Adam,

Thanks, your solution works for me.
I ended up using the most recent timestamp of files in two locations for each repo.
/var/log/rhn/reposync and /var/cache/rhn/repodata/reponame.

I was too focused on finding out the repo sync time by using SuseManager related tools , so I did not look into good old Linux tooling :slight_smile: