Hello I have problem with script lynx + cron. We would like search something every minute and save to file.
If I run script without cron every work fine but if scrip run by cron the file is empty.
After run script with cron the file info.txt contains only date:
If I run script without cron every work fine but if scrip run by cron the file is empty.
Code:
#!/bin/sh
data=` date | cut -d ' ' -f2-4 -f6`
hasp3_physical=`lynx -dump http://web-page | grep Kasa | grep Handel | cut -d ' ' -f6`
hasp4_physical=`lynx -dump http://web-page | grep Kasa | grep Handel | cut -d ' ' -f9`
echo $data ";" $hasp3_physical ";" $hasp4_physical >> /home/info.txt
After run script with cron the file info.txt contains only date:
Code:
Aug 24 23:25:00 2016 ; ;
Aug 24 23:25:00 2016 ; ;
Aug 24 23:25:00 2016 ; ;
Aug 24 23:26:00 2016 ; ;
Aug 24 23:26:00 2016 ; ;
Aug 24 23:26:00 2016 ; ;
Aug 24 23:27:00 2016 ; ;
Aug 24 23:27:00 2016 ; ;
Aug 24 23:27:00 2016 ; ;
Aug 24 23:28:00 2016 ; ;
Aug 24 23:28:00 2016 ; ;
Aug 24 23:28:00 2016 ; ;
Aug 24 23:29:00 2016 ; ;
Aug 24 23:29:00 2016 ; ;