I have a script that does a ssh connection to a Ubuntu machine to get a file and store it on my raspberry pi. If I execute the script manually, in shell it works perfectly how I want it but in crontab -e it doesn't work. I also have another script in crontab that I also start with @reboot and this script works perfectly fine on reboot. I assume that the script is getting executed without the network being up but I don't know how to work around it.
This is my crontab -e :
@reboot bash /home/pi/skript/conf.sh
@reboot node /home/pi/node/buttonled.js
and this my script:
#!/bin/bash
file=`(ssh davy@192.168.0.15 ls -t /home/davy/rundgaenge | head -1)` 2>/home/pi/skriptfehlermeldung.txt
scp davy@192.168.0.15:/home/davy/rundgaenge/$file /home/pi/rundgangConf/