I suspect behavior of setting HOME).
I have a backup script I run in the root crontab but I had a tricky issue with restic/rclone where running the script from the command line worked but from cron failed silently. After some debugging I noticed rclone was using the rclone.conf from my regular user home folder when run in the command line and not from root account”s home folder.
So I noticed that “sudo -i” was working as opposed to “sudo -s” failing. In this Ubuntu 18.04 client I am working on the behavior of sudo differed from what I was used to. See below:
rrosso@u1804:~$ sudo -iroot@u1804:~# echo $HOME/root
root@u1804:~# logoutrrosso@u1804:~$ sudo -sroot@u1804:~# echo $HOME/home/rrosso