1#
2# (c) Jan Gehring <jan.gehring@gmail.com>
3#
4# vim: set ts=2 sw=2 tw=0:
5# vim: set expandtab:
6
7package Rex::Cron::SunOS;
8
9use 5.010001;
10use strict;
11use warnings;
12
13our $VERSION = '1.13.4'; # VERSION
14
15use Rex::Cron::Base;
16use base qw(Rex::Cron::Base);
17
18use Rex::Helper::Run;
19use Rex::Commands::Fs;
20
21sub new {
22  my $that  = shift;
23  my $proto = ref($that) || $that;
24  my $self  = $proto->SUPER::new(@_);
25
26  bless( $self, $proto );
27
28  return $self;
29}
30
31sub read_user_cron {
32  my ( $self, $user ) = @_;
33  my @lines = i_run "crontab -l $user";
34  $self->parse_cron(@lines);
35}
36
37sub activate_user_cron {
38  my ( $self, $file, $user ) = @_;
39  i_run "crontab $file";
40  unlink $file;
41}
42
431;
44