Need Help with a Bash script
Budget: $10 – $30 USD
Hello,
I have started this script. What it does is sorts through all users who are have logged in to an application. then at the 30 day mark it needs to send me an email. I need to set this up as a cron job to run each day. Here is the part that I have so far.
Issue - I would have to know each user that logs into the system and they each would have to have their own file. Possible solution is to have it going to one file that would be appended each day. and when the count down hits 0 it then sends email.
-Section that need to be updated
grep '@mail.com' logfile.log > test.txt ; cut -d ':' -f1,2,3,10 test.txt > test1.txt ; cut -d ',' -f1 test1.txt > test2.txt ; grep 'mail.com' test2.txt | sort -u | sort -g | sed 's/"/|/g' | awk -F'|' '{print $2,$1}' OFS='|' | sort -u | sed 's/+00:/+00/g' | awk -F\| '{print>$1}'
I have started this script. What it does is sorts through all users who are have logged in to an application. then at the 30 day mark it needs to send me an email. I need to set this up as a cron job to run each day. Here is the part that I have so far.
Issue - I would have to know each user that logs into the system and they each would have to have their own file. Possible solution is to have it going to one file that would be appended each day. and when the count down hits 0 it then sends email.
-Section that need to be updated
grep '@mail.com' logfile.log > test.txt ; cut -d ':' -f1,2,3,10 test.txt > test1.txt ; cut -d ',' -f1 test1.txt > test2.txt ; grep 'mail.com' test2.txt | sort -u | sort -g | sed 's/"/|/g' | awk -F'|' '{print $2,$1}' OFS='|' | sort -u | sed 's/+00:/+00/g' | awk -F\| '{print>$1}'