I've checked this link for suggestions but I can't seem to get a .sh script working. I'm new to Ubuntu and Linux (from Windows).
Why crontab scripts are not working?
Here is the dummy .sh I'm testing.
It's called testing.sh
#! /bin/bash
ls > testing.txt
Here is how my crontab looks like:
SHELL=/bin/bash
* * * * * "/home/name/Desktop/Instragram Scraper/Instagram looter/batch_scripts/testing.sh"
* * * * * "/home/name/Desktop/Instragram Scraper/Instagram looter/batch_scripts/daily_0.sh"
****other randoms cron jobs******
I've looked at the environmental paths for cron as well as the shell and but it seems they have variables in common so I'm assuming PATH is not a problem?
Here is Crontab's environmental variables (so I tried changing the shell command by adding it to the top of the cron file):
HOME=/home/name
LOGNAME=name
PATH=/usr/bin:/bin
LANG=en_US.UTF-8
SHELL=/bin/sh
PWD=/home/name
Here is env from the shell:
PATH=/home/name/bin:/home/name/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
SHELL=/bin/bash
Not sure what I'm doing wrong.
EDIT:
It seems the text files are being created under HOME, so I was looking at the wrong place. However when running a real (not dummy) cron command, the cron command doesn't seem to be running these commands from my .sh script:
"instalooter hashtag "donut" "/media/name/data/" -n 100 -j 2 --new"
basically the instalooter command doesn't seem to be running,
which if I run via the cmd line or if I run the same script via command line, those commands have no problem being ran.
Is this an variable problem?
Thank you.
I've updated the OP.
– Sayaka Nov 14 '18 at 05:56which instalooter
. – Manula Waidyanatha Nov 14 '18 at 06:09