file::cleanuptask

20

Click here to load reader

Upload: alex-balhatchet

Post on 01-Jul-2015

319 views

Category:

Technology


0 download

DESCRIPTION

File::CleanupTask is a CPAN module that the company I work at has opensourced. This is a presentation I gave about it at the London Perl Mongers technical meeting in August 2012.

TRANSCRIPT

Page 1: File::CleanupTask

File::CleanupTask

CPAN module from Savio Dimatteo (DARKSMO)

Presentation by Alex Balhatchet (KAORU)

Page 2: File::CleanupTask

A little about me

Page 3: File::CleanupTask

A little about Lokku/Nestoria

We're hiring! http://lokku.com/jobs

Page 4: File::CleanupTask
Page 5: File::CleanupTask

File::CleanupTaskConfiguration based file deletion and backup

Page 6: File::CleanupTask

The Problem

o Lots of logs and junk lying aroundo How to delete old files and save disk space?o How to avoid deleting the wrong things?!

Page 7: File::CleanupTask

The Solution

o Point it at a directoryo Tell it how old files are allowed to beo Files go away!

Page 8: File::CleanupTask

The Solution

o Configuration driveno Designed to be run via crono Super awesome dry-run and verbose modes

Page 9: File::CleanupTask

Action!

~$ run-file-cleanuptask \ --conf ops.tasks \ --taskname snapshot \ --verbose

Page 10: File::CleanupTask

Basics

[logs]path = /home/...max_days = 14recursive = 1

Page 11: File::CleanupTask

Pattern Matching

[searchindexbuild-reports]max_days = 7path = /home/...pattern = /[/]report.+$/recursive = 1

Page 12: File::CleanupTask

Pattern Matching

[releases]max_days = 3path = /home/...do_not_delete = /important.txt/recursive = 1

Page 13: File::CleanupTask

Backup instead of delete

[dropbox-backupraw]path = /home/...max_days = 4backup_path = /home/.../old/recursive = 1

Page 14: File::CleanupTask

Compress those backups

[dropbox-backupraw]path = /home/...max_days = 4recursive = 1backup_path = /home/.../old/backup_gzip = 1

Page 15: File::CleanupTask

Keeping Tidy

[temp]max_days = 20path = /home/...prune_empty_directories = 1recursive = 1

Page 16: File::CleanupTask

Keeping Tidy

[releases]max_days = 3path = /home/...delete_all_or_nothing_in = /home/...recursive = 1

Page 17: File::CleanupTask

Hey, I'm using that!

[geobuilds]max_days = 5path = /home/...keep_if_linked_in = /home/...recursive = 1

Page 18: File::CleanupTask

CPAN Module

Please try File::CleanupTask out!

https://metacpan.org/module/File::CleanupTask

Forks and pull requests welcome!

https://github.com/darksmo/File-CleanupTask

Page 19: File::CleanupTask

Questions?

Page 20: File::CleanupTask

Thanks!Reminder: we're hiring! http://lokku.com/jobs