13 comments on “Automatic Sonicwall Backup Script

  1. This post was extremely helpful, but it doesn’t seem to work for me. I have the .sh file configured correctly, but it isn’t starting the ssh connections to the sonicwalls. What could be wrong?

  2. Pingback: Sonicwall backup via ssh FTP failure CopyQuery | Question & Answer Tool for your Technical Queries

  3. I had an issue with one of the sonicwalls not allowing SSH connections it. boiled down to the sonicwall having zombied ssh sessions. You could try a reboot.

    Other than that you could try to do the steps 1 by 1 manually and see if it all works.

    • Thanks for the reply. I’ve been testing with the .exp file using static values instead of variables and found a new issue where the ssh goes through and it tries to run the export command, but it comes up with an error “FTP Failure!”. I can ftp to that server with the same credentials from another PC, so I’m not sure what the problem could be.

  4. check the firmware version on the Sonicwall. Another issue i had was that the export to FTP wasn’t considered a valid command because it had not been implemented yet. Since this was quite a old version i just pushed a update to it and carried on.

    See this line in the blog.
    I have found that your sonicwall needs to be about firmware 5.1.x + in order for this to work correctly.

    Maybe this could be your issue ?

    The way i found this was doing the commands manually on this sonicwall and making sure it all work.
    I was quite surprised when I found the CLI telling me i was putting in the incorrect command.

    Goodluck getting this information out of sonicwall themselves 🙂

    Hope this gets you going.

    • We are running firmware 5.8.x, so that doesn’t seem to be the issue. I appreciate your feedback. I’ll keep troubleshooting the issue.

  5. Last thing I would suggest then is using Filezilla Ftp server. Its logging is really good. Another option is wireshark. That would tell you if the packets are even getting sent to the server.

    Maybe it is something as simple as a firewall or Anti-Virus blocking the traffic.

    • I feel really stupid right now. Turns out the problem was that vsftpd wasn’t started. Not sure why I could ftp in from another machine, but once I started the service is worked.

    • Well, sort of working. The ssh bit works, but the script as a whole isn’t. I’m back to my initial issue where the script runs but doesn’t run the cases for some reason. I’m combing through the script to find out what is missing.

      • Got it sorted out. The case names needed double quotes, not single. Thanks for your script. It is a great help!

  6. This script proved to be even more useful, as I was able to modify it to pull configurations from our ProCurve switches as well!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s