Set-up
I have 3 .txt
files containing commands to be executed each day.
The berlin_run.txt
file executes a.o. the 2 other .txt
files. The file is the following,
#!/bin/bash
cd /path/to/folder/containing/berlin_run.txt
PATH=$PATH:/usr/local/bin
export PATH
./spider_apartments_run.txt
./spider_rooms_run.txt
python berlin_apartments_ads.py;python berlin_rooms.py
When I cd
to /path/to/folder/containing/berlin_run.txt
in my MacOS Terminal, and execute the ./berlin_run.txt
command, everything works fine.
It is my understanding that ./
opens the berlin_run.txt
, and that #!/bin/bash
ensures that the subsequent lines in the berlin_run.txt
are automatically executed upon opening.
Problem
I want to automate the execution of berlin_run.txt
.
I have written the following cronjob,
10 13 * * * /path/to/folder/containing/berlin_run.txt
It is my understanding that this cronjob should open the berlin_run.txt
each day at 13:10
. Assuming that is correct, #!/bin/bash
should execute all the subsequent lines. But nothing seems to happen.
Where and what am I doing wrong here?