Run backup file by script

Try to used a script to restore the “.backup” file, but not work

/system ssh address=192.168.88.1 “/system backup load name=123.backup”

any solve ?

I do not believe if it possible to use “/system shh” from a script" since it will prompt for a password.
Much like the same issues with upgrade-package-source.

Running a script containing:

/system ssh 127.0.0.1 "/ip address print" user=admin

Seems to fail silently.

The log throws an error when I attempt to import a file (test.rsc) containing:

/system ssh 127.0.0.1 "/ip address print" user=admin

Via a script:

/import test.txt

I think it is safe to assume that it is impossible.

The full command as below

/user add name=admin1 group=full

/system backup
save name=emac dont-encrypt=yes password=P@ssword

/system ssh address=192.168.88.1 user=admin1 "/system backup load name=emac.backup password=P@ssword

Run fine in terminal command, but cant to use “/system ssh” from a script

I think similar like http://forum.mikrotik.com/t/remote-ssh-via-script/64915/1

The ssh command is missing a ", but other than that the SSH command won’t work when run from a script, as I said.

Also, why are you creating the user and backup locally and then try to use a SSH session? Is 192.168.88.1 the router itself?

It would help a lot if you explained what you are trying to do.

Yeah, same problem as the one I posted.
Any command that requires the use of a user on remote router cannot be run using a script.

If you wanna do stuff like this remotely, I would suggest looking into the API instead.
It should be as simply as:

/system/backup/load
=name=emac.backup
=password=P@ssword

See: http://wiki.mikrotik.com/wiki/Manual:API

Here’s mine. Backup and export, and E-Mail both to one of my addresses.

# Policies needed:  ftp, read, policy, sensitive, test
# Policies NOT needed:  password, reboot, write, sniff, romon
:log info "Starting daily backup";
/system backup save name=RB750-2_Daily
:delay 00:00:01
# :log info "Starting to send E-Mail of backup file";
/tool e-mail send file=RB750-2_Daily.backup to="xxx@yyy.org" body="Router #2 daily backup file attached." \
   subject="RB750-2  $[/system clock get date] at $[/system clock get time]  Backup"
# :log info "Backup file sent - starting 10 second delay";
# :delay 00:00:10
:log info "Starting export of script file";
/ export file RB750-2_Daily
:log info "Export file created";
:delay 00:00:10
# :log info "Starting to send E-Mail of script file";
/tool e-mail send file=RB750-2_Daily.rsc to="xxx@yyy.org" body="Router #2 daily script file attached." \
   subject="RB750-2  $[/system clock get date] at $[/system clock get time]  Script"
# :log info "Script file sent";
:log info "Daily backup script completed"

The extra log entries that are remarked out were for troubleshooting when I first created the script. They can be removed. The delay after creating the export WAS required as that takes several seconds and the send E-Mail would fail because the file was still being written.

I don’t how that is related to OP’s problem.
The OP is trying to do the opposite of what your script does.

I think.

You’re right. I misread the original post. Sorry.