Hello this is purely practicing my cronjob Here is my bash script below :
#!/bin/bash
grep $1 $2
rc=$?
if [ $rc != 0 ]
then
echo "specified string $1 not present in $2"
else
echo "specified string $1 is present in the file $2"
fi
# number of lines of in a file
wc -l $2 | awk '{print $1}'
Here is my crontab below :
20 16 * * * /home/mbarrett/Desktop/ ./find_string.sh sam text_string.file > /var/log/backupstring.log 2>&1
Any advice to what I may be doing wrong?