It is currently Thu Mar 28, 2024 3:41 pm

All times are UTC - 7 hours [ DST ]

Recent News:



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Mar 31, 2009 8:10 pm 
Offline
2.0TB storage
2.0TB storage

Joined: Sat Aug 09, 2008 8:54 am
Posts: 172
Location: Miami Beach, FL
Thanks: 10
Thanked: 7 times in 6 posts
Just clicked this little PowerShell-Script together to get rid of some files which are being constantly being created but won't be used anymore if they get too old. Thought that some of you might have a use or two for it as well (think of logs):
Code:
Get-ChildItem -incl '*.mp4' -path 'd:\shares\users\axis\*'|
?{$_.LastWriteTime -lt (get-date).AddDays(-7) -and !$_.PSIsContainer}|
remove-item

What it basically does: Delete every .mp4-File from c:\shares\users\axis which is older than seven days. Feel free to adapt it as necessary.

If you put " -whatif" at the end of it all it will just show you which files are selected by the above statement instead of deleting them.

_________________
HP EX475, 2GB RAM, BE-2300 | Linksys WRT54G (Tomato)


Top
 Profile  
Thanks  

Attention Guest: Remove this ad by Registering with the MediaSmartServer.net Forums. It's Free!
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group