Create scheduled back-ups from the command line

Is there a way to create scheduled back-ups from the command line for all or individual virtual servers? I haven't been able to figure this out myself, and it's laborious to do so for multiple domains in the web interface.





Howdy -- thanks for contacting us!

While there is unfortunately not a way to create a scheduled backup from the command line, it is possible to perform a backup there.

You could use the "backup-domain" parameter, and pass in the options you want to that. If you then added that to cron, it could act as a scheduled backup.

Thanks Eric, but that cuts the user out of the process of creating and managing their own back-ups, unless there is a way to make cron-initiated back-ups show up in the user's Backup Logs?

What about adding them to Account Plans or Server Templates?

I'll change this to a feature request.

Category: Support request ยป Feature request

Right now there is no way to do this ... however, are you looking for a way to create a separate scheduled backup for each domain, which can be managed by its owner? If not, you could create a single backup that covers all domains.

Unfortunately craigh, we're not likely to add a way to create a new scheduled backup from the command line anytime soon.

Anything you're looking to do with Scheduled Backups, you'd need to do those through the GUI.

If you can describe what your goal is though, we may be able to provide assistance with achieving what you're after using the GUI.


Thanks, but I'm a bit confused by this: "... however, are you looking for a way to create a separate scheduled backup for each domain, which can be managed by its owner?" I'm only confused because, yes, that's exactly what I want, so I didn't realise there was another interpretation of what I asked in my original message. I am aware that I can create a scheduled back-up using cron and virtualmin backup-domain that covers all domains (Eric's suggestion in comment #1, and now your suggestion in comment #4), but really that was never a serious consideration on a server with a control panel that individual virtual server owners can log into. Ideally though I would like my users to see evidence that their virtual servers are being backed up (and have a way to manage it to their liking, which Virtualmin already provides) rather than simply trusting that I have some secret back-up process running (which I do anyway outside of Virtualmin).


Your response confuses me further, given what I wrote to Jamie above. :)

I'd love to work through the GUI exclusively (and I do generally) if the set of operations that can be done by mass updates can be expanded. How about being able to create a back-up template and being able to apply that to an existing virtual server, or attaching it to an Account Plan (as either a "feature" or "capability", perhaps) and having the scheduled back-up created when a new virtual server is created?

Bottom line is that it's laborious, for root, to create back-up schedules through the GUI for multiple virtual servers. (I started to count clicks and scrolls and typing, but it's obvious that the command line is superior in some circumstances.) It has always been (as long as I've been using Virtualmin, which is only just over two years), but it has become a specific issue at this time because the export/import (migration) process did not bring across the scheduled back-ups from my old server to the new server, so I was (desperately) hoping I could run a series of scripted commands to recreate the scheduled back-ups on the new server.

What I was referring to is the ability in the UI to create a single scheduled backup that covers all domains, but if your requirement is that users have the ability to see and manage their own backup schedule, this won't work for you.

However, as of a few Virtualmin releases ago, domain owners can see and restore backups (on the Backup Logs page) that were made by a global schedule created by the root user.