Schedule a Task to Cleanup a Log Folder

Introduction

Have you been alerted about a drive filling up over the weekend during your monthly patching schedule? What a bad moment to get a warning like this and have to deal with before the server locks up by Monday morning. Expanding a drive can be your first reaction, but after it fills up again a few months later you dive into it by analyzing disk space only to find it’s a pesky Log folder filling up for years now. Say no more, let’s schedule a task to cleanup a log folder!

How To Schedule a Task

Here is some light reading on using forfiles – a way to select and execute a command on a file or set of files. We are going to use it to clean up a folder on a Network Policy Server.

  1. Open Task Scheduler – Create a basic task
  2. Give it a Name and Description
  3. Trigger – how ever often you would like to clean it up
  4. Action – Start a program. These are the specific details I have used:
    Program/script: Forfiles.exe
    Add arguments: /p C:\Windows\System32\LogFiles\NPSLogs /m *.log /d -30 /c “Cmd.exe /c del @file”
    Start in: C:\Windows\System32
  5. Once complete Run Now to see if it works – backup the folder first!

Tips

Here are a few more thoughts to keep in mind:

  • If you are concerned about the data be sure to copy the entire log folder somewhere else while you test out this process.
  • Run the task as a local Admin account or a service account where the password won’t change. Otherwise the script will stop running after you change your password.
  • You can delete more than just log files, look above in the argument for the *.log parameter for file type. You can change this up to a different file type if your software uses a different kind.

Conclusion

Hope this helps you schedule a task to cleanup a log folder. I’ve found it’s better to be proactive about this, before you know it years have passed since you setup the server and you wished you would have taken the 15 minutes to have a scheduled task. See more posts about IT Operations here.

Push Notifications For RSS Feeds with iOS

Background

In the growing age of Software as a Service (SaaS) applications it’s critical to monitor outages and service degradation. Most SaaS companies have a status page you can check, some offer ways to sign up for alerts to email or txt messages. Personally, I prefer RSS feed because I can centralize all my feeds into one place. Let’s take a look at a way to get push notifications for RSS feeds.

Feedly and IFTTT

When Google Reader met it’s demise I searched around for a few different RSS apps and came across Feedly. I’ve been hooked ever since! Along with Feedly is an automation service IFTTT – short for If This Then That. It’s a great way to automate actions between account services.

Setup

  1. In order to do everything below you will want to create accounts in both Feedly and IFTTT.
  2. In Feedly you will want to “Create a new Feed” and call it something like RSS Notifications. This will act as a category to subscribe to all your RSS feeds.
  3. Now go to “Add Content” and paste in the URL for the RSS feed you want to subscribe to. Add to your RSS Notifications feed category. For example: https://status.slack.com/
  4. After adding the RSS feeds you want let’s go to IFTTT, there is a specific applet already created you can use called Feedly iOS Push Notifications – connect this to the Feedly category you created and you should be good to go!

Summary

I hope these push notifications for RSS feeds help you stay on top of the services you have and know when to inform others that they should expect possible issues. Communication is key for any team or business!

Create a List in Office 365 for Email reminders

Overview

Have you missed an item that needed renewed and caused the whole world to crash down? OK, maybe not the whole word but I’m sure you’ve felt the stress of, “Oh no, that certificate just expired and everyone is getting warned it’s an unsafe site!” Over the years I’ve heard lots of well intended ideas by people, “Let’s keep all of these in your IT asset management system, or you can use our contract system, or enter it as a financial renewal in our ERP system.” Time and time again, those are very cumbersome and expensive when all I needed was a simple list that could email my a notification. Say no more, let’s create a list in Office 365 and a Flow to get email alerts.

Setup

If you haven’t used an Office 365 Group yet it’s a collection of collaboration services all tied to a single group of people. All the permissions are set at the Group level and all users get access to things like a Shared Mailbox with email address, OneDrive document library, SharePoint site, etc. Let’s create a list and customize for what we want to keep track of.

  1. Create an Office 365 Group or go to an existing Group you have access to.
  2. Go to SharePoint app to see your Group – Click the New dropdown >
  3. Create a List
  4. Customize your list – add items – organize columns – etc.
  5. Add an item to your list

There you go! Now once you have an item added you can click the Flow drop down and you should see Set a reminder > Date Due. Since I added a column with a date, SharePoint was smart enough to create a built in Flow for a reminder based on the due date.

Summary

That’s it! Now sit back and wait for the reminders to renew your items. Flow is a built in app from Microsoft that can be used all over Office 365. Create a list in Office 365 is just one quick example of what it can do. Learn more about Flow here.

So why Office 365 and Lists? If you use Microsoft Office 365 for all of your core business collaboration solutions then it’s probably never going away. Seems like a pretty simple solution to me. Give it a try and let me know how it goes or if you any other tips.