Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Timestamp issue

Featured Replies

Hi,

 

I've a issue modifying the timestamp of folders on Unraid. I've made a Powershell script tha scans the folder, and changes the folders timestamp to that of the oldest file. Everything is working fine when running it on a folder on my windows machine, however running it on a shared Samba folder doesn't work. The timestamp of the folder located on the Unraid server does not get updated.

 

I'm running a 5.0.5 version of Unraid

 

Any help appreciated

 

Powershell script:

$folders = Get-ChildItem $root | Where-Object {$_.PSIsContainer} | Sort Name

foreach($folder in $folders)

{

Write-Warning $folder.fullname

 

$oldest = Get-ChildItem -LiteralPath $folder -Force | Sort LastWriteTime | select -First 1

Write-Host $oldest

Write-Host $oldest.LastWriteTime

 

if($oldest)

{

#oldest object found, set current directory LastWriteTime

$Crea = Get-ItemProperty -Path $folder -Name CreationTime

$Last = Get-ItemProperty -Path $folder -Name LastWriteTime

Write-Host $Crea

Write-Host $Last

 

Set-ItemProperty -Path $folder -Name CreationTime -Value $oldest.LastWriteTime -force

Set-ItemProperty -Path $folder -Name LastWriteTime -Value $oldest.LastWriteTime -force

 

}

else

{

# current directory is empty, directory LastWriteTime is left unchanged

Write-Warning "Directory '$($folder.FullName)' is empty, skiping..."

$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

}

 

}

Write-Host

Write-Warning "Done..."

$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

 

  • Author

Anyone??

Not sure you can expect something which works on Windows local files to work on SAMBA or Linux. Might need to do some more research about that.

 

Alternatively, you could probably write a bash script to do it at the unRAID command line.

 

 

  • Author

But should it not be possible to change the timestamp on the files through Samba??

 

Unfortunately i don't know any Linux, nor any Bash.

But should it not be possible to change the timestamp on the files through Samba??

 

Unfortunately i don't know any Linux, nor any Bash.

Googling makes me think that you have to make some settings in samba to allow this, or that it might even be broken in samba.

 

Probably some googling would get you a bash script for what you want.

Hi,

 

I've a issue modifying the timestamp of folders on Unraid. I've made a Powershell script tha scans the folder, and changes the folders timestamp to that of the oldest file. Everything is working fine when running it on a folder on my windows machine, however running it on a shared Samba folder doesn't work. The timestamp of the folder located on the Unraid server does not get updated.

 

I'm running a 5.0.5 version of Unraid

 

Any help appreciated

 

Are you using user shares or disk shares?

  • Author

Usershares!

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.