/backup folder in automation and SSH calls

I am new in HA and I need your help. I created test.sh file in my config folder. The file content code that check folder /backup and copy file from it to another folder. When I run the file from SSH terminal it works. When I run the file from automation by “shell_command” it does not work because ti looks like the script can not see /backup folder. Can you help me if is it possible allow reading for this folder from automation?

Second question what I have is that I would like use ssh command. It is connected with my first question. I suppose that addon SSH use something like ssh command because it requires token that I have to generate. Can I use same commands in my scripts? I mean that I will call something like

ssh -i /config/.sshHA/id_rsa -o 'StrictHostKeyChecking=no' root@haipaddres '/config/scripts/test.sh'

I tried do it same way like SSH’ing from a command line, but I get “Permission denied (publickey)” all time. I hope that if this ssh command will work I could read backup folder.

Can you help me with this?

Thank you for your suggestions