Hi everyone!
I'm finding myself stuck at the cron resource. Basically I've created a shell script file with file resource and added in the crontab with the cron resource. The thing is the cron executes but the shell script file no.
Can someone point me in the right direction?
node 'sysadmin-virtualbox'{
$str = "#!/bin/bash\ncurrentUser=\$whoami\nmyId=\$(id \$currentUser | awk '{print \$1}'| cut -f2 -d'='| cut -f1 -d'(')\necho 'You will be prompted for elevated rights'\nsudo apt-get -y install curlftpfs\ns"
file{'/var/log/SYSADMIN.sh':
ensure => present,
content => $str,
owner => sysadmin,
group => sysadmin,
mode => 775,
}
cron {'mountftp':
ensure => 'present',
command => "cd /var/log; ./SYSADMIN.sh",
user => 'sysadmin',
hour => '*',
minute => '*/2',
}
}
↧