I have a bash script to backup my raspberry pi, and after running the backup command my pc is supposed to powerdown. This works when I just run the script via the command line. But when cronie executes it, it immediately jumps to the shutdown command instead of waiting for the backup to finish.
What can I do about that?
#!/bin/bash ssh email@example.com dd if=/dev/mmvblk0 bs=1M | gzip -c > /path/to/backup/$(date -I) && systemctl poweroff