Koozali.org: home of the SME Server

Need to get file Last Access Date/Time

Offline InteXX

  • **
  • 39
  • +0/-0
    • www.intexx.com
Need to get file Last Access Date/Time
« on: February 09, 2010, 08:06:21 AM »
Is there a way to get the Last Access Date/Time for a file that's stored in a user's home folder on SME 7.4?

Windows Explorer in WinXP returns incorrect information; although I haven't tested I assume my VB.NET program will as well.

Thanks,
Jeff

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Need to get file Last Access Date/Time
« Reply #1 on: February 09, 2010, 02:55:59 PM »
From a shell prompt:
Code: [Select]
ls -l --time=access

Offline InteXX

  • **
  • 39
  • +0/-0
    • www.intexx.com
Re: Need to get file Last Access Date/Time
« Reply #2 on: February 10, 2010, 05:51:46 AM »
Got it, thanks.

But actually I was looking for a way to automate it entirely within Windows. VB.NET doesn't know what a shell prompt is, I'm afraid.

I need to periodically cull files out of ibays based on last access date, in order to keep unnecessary bloat out of backup sizes.

Pardon me for not explaining this up front.

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: Need to get file Last Access Date/Time
« Reply #3 on: February 10, 2010, 03:16:52 PM »
Pardon me for not explaining this up front.
Well, I could have guessed that you weren't running your VB.NET program on the SME...

I found this: http://oreilly.com/catalog/samba/chapter/book/ch08_01.html#ch08-56646.  Is it possible you need to set dos filetimes in /etc/samba/smb.conf in order to allow the file access times to be updated?

Another option: schedule a cron job on your SME server that creates a text file containing the names of files to include (or exclude) from your VB.NET app.

Yet another option: look into Affa for backup...

Offline InteXX

  • **
  • 39
  • +0/-0
    • www.intexx.com
Re: Need to get file Last Access Date/Time
« Reply #4 on: February 10, 2010, 08:29:18 PM »
Your cron job suggestion is the most interesting. Our root problem in this is low bandwidth going out of the building.

But this sounds like a good solution. Thanks!