0

I have the below script running successfully manually. But when it is executed in crontab (below), I dont see anything happening.

Script

#!/usr/bin/gawk -f
#!/bin/bash

PATH=/usr/local/bin:/usr/bin

#Reading from the file & storing in array array=() while read -r line; do array+=($line) done < /etc/folder/automation-script/ip.txt

#Removing the lines based on line number of file

gawk -i inplace 'NR==30 {next} {print}' /etc/folder/default.vcl gawk -i inplace 'NR==38 {next} {print}' /etc/folder/default.vcl

#Adding lines based on line number of VCL file

gawk -i inplace -v line1=${array[0]} 'NR==30{print ".host = ""\042"line1"\042"";"}1' /etc/folder/default.vcl gawk -i inplace -v line2=${array[1]} 'NR==39{print ".host = ""\042"line2"\042"";"}1' /etc/folder/default.vcl

Crontab

35 04 16 11 * /etc/folder/automation-script/autoscript.sh

0 Answers0