you can see that the lxc client of the snap package is located in the /snap/bin directory.
Therefore, you need to add /snap/bin to the $PATH.
Normally, the shell’s $PATH has /snap/bin. In your script though, you set the $PATH to specific values, therefore you need to take care of adding /snap/bin in there yourself.
Sorry for recovering an old post but maybe it worths a mention.
Reverting from deb to snap lxc installation I was banging my head why server backup scripts stopped being able to be executed from home (remotelly). Could be ran locally though.
Its the same answer. lxc exec db -- mysqldump --add-drop-table databasename | gzip > /home/username/mysqldump/databasename-$(date '+%d-%m-%Y').sql.gz
should become /snap/bin/lxc exec db -- mysqldump --add-drop-table databasename | gzip > /home/username/mysqldump/databasename-$(date '+%d-%m-%Y').sql.gz
The reason is that interactive users on a system with snaps, get /snap/bin/ into their $PATH through /etc/profile.d/apps-bin-path.sh.
If somehow this /etc/profile.d/apps-bin-path.sh does not run for you (like in cron), you do not automatically get /snap/bin into your $PATH.