Script restore-domain not write log

I wrote a script that you need to restore via cron.
I want to write to a log the results of the restore but this does not work.
If I run the script manually it works.
It works if I click on the button with virtual min Run Now.
It does not work when run time with Cron creates the empty file.

virtualmin restore-domain --source ssh://sshback:‘pippo’@ --all-domains --all-features > /root/log_restore.log

I know you help?


A couple things you might try –

Since it’s being run from cron, if you temporarily disable the redirect to the logfile, it will instead email you any output the script is generating. You can do that to see if it is indeed generating any output at all.

Also, sometimes there’s path issues in cron. When you call “virtualmin”, you may want to use the full path, so that would become “/usr/sbin/virtualmin” rather than just “virtualmin”.


thanks. I try and let you know.

It does not work

Does the cron job perform the restore and just create an empty log file, or does it skip the restore altogether?

Otherwise, what exactly did you try now (Eric suggested two things), and what “did not work” exactly?