rpi-clone icon indicating copy to clipboard operation
rpi-clone copied to clipboard

Errors sudo crontab rpi-clone sda -u

Open thunder2k opened this issue 6 years ago • 4 comments

Hi, Thanks for this great project, that's exactly what I was looking for! It's working flawlessly when I run it manually.

When I tried to schedule the following command via sudo crontab: /usr/local/sbin/rpi-clone sda -u I got the following error output via email:

Command not found: parted Package required: parted Command not found: fdisk Package required: util-linux Command not found: fsck.vfat Package required: dosfstools

Do you want to apt-get install the packages? (yes/no): Aborting!

Am I missing something or there's an issue here?

Thanks!!

thunder2k avatar Nov 05 '18 18:11 thunder2k

I was also having this same issue and discovered that the script has no PATH set and thus the cron user is unable to properly locate those commands. By editing the script with the following it fixed it:

vi /usr/local/sbin/rpi-clone

add the following under the first line of "#!/bin/bash": #!/bin/bash export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin"

charlie-young avatar Apr 03 '19 14:04 charlie-young

Thanks for the hint, I'll test it and let you know!

EDIT: I've tested it and works perfectly,thanks a lot!!

thunder2k avatar Apr 03 '19 14:04 thunder2k

Many thanks @charlie-young! I was having this exact issue as well 👍

heylookltsme avatar Apr 25 '20 19:04 heylookltsme

#!/bin/bash export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin"

Oddly enough, although I have the latest version of the script on my Pi 3B+, this line was not present. I added it. Hopefully I stop getting that error message.

jdrch avatar May 10 '21 03:05 jdrch