Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PowerShell Core for Linux Administrators Cookbook

You're reading from   PowerShell Core for Linux Administrators Cookbook Use PowerShell Core 6.x on Linux to automate complex, repetitive, and time-consuming tasks

Arrow left icon
Product type Paperback
Published in Nov 2018
Publisher Packt
ISBN-13 9781789137231
Length 566 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Ram Iyer Ram Iyer
Author Profile Icon Ram Iyer
Ram Iyer
Prashanth Jayaram Prashanth Jayaram
Author Profile Icon Prashanth Jayaram
Prashanth Jayaram
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Introducing PowerShell Core 2. Preparing for Administration Using PowerShell FREE CHAPTER 3. First Steps in Administration Using PowerShell 4. Passing Data through the Pipeline 5. Using Variables and Objects 6. Working with Strings 7. Flow Control Using Branches and Loops 8. Performing Calculations 9. Using Arrays and Hashtables 10. Handling Files and Directories 11. Building Scripts and Functions 12. Advanced Concepts of Functions 13. Debugging and Error Handling 14. Enterprise Administration Using PowerShell 15. PowerShell and Cloud Operations 16. Using PowerShell for SQL Database Management 17. Using PowerShell with Docker 18. Other Books You May Enjoy

Removing scheduled jobs in PowerShell

In this recipe, we're going to see the steps to remove the entries from the CronTab file.

How to do it...

Now that we have created entries into the cron configuration file, let's attempt to remove those entries:

  1. List the jobs using the Get-CronJob cmdlet. This will get you the list of jobs that are created by reading the CronTab file:
PS> Get-CronJob | Format-Table -AutoSize
  1. Apply a conditional logic to segregate the required job entries using the Where-Object clause. You will read more about this in Chapter 4, Passing Data Through Pipelines:
PS > Get-CronJob | Where-Object {$_.Month -match 'Jan'} | Format-Table -AutoSize 

Minute Hour DayOfMonth Month DayOfWeek...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime