Answer to question 1:
Assuming you mean cron
, yes it's possible, and without knowing more details about your environment it'll be impossible to guess whether there is a better way or not.
Answer to question 2:Sounds like you want the SSH/scp client to automatically accept the host key of the remote end.
The most secure way to do it would be to use scp -o StrictHostKeyChecking=accept-new ...
, which will auto-accept host keys of previously-unseen remote hosts, but will stop and alert if it sees that a previously-known host key has been altered.
If you trust that the risk of man-in-the-middle attacks is low and want even more convenience (or if you have an old SSH implementation), you could use scp -o StrictHostKeyChecking=no ...
which will accept all new and changed remote host keys automatically.
The default is equivalent to scp -o StrictHostKeyChecking=ask ...
.