• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Cron Job for whole service package

DHMG

New Pleskian
Hello!

Is it possibly to set up a cron job for all domains that belong to a specific service-pack and if so, how would I go about it to set that up with the Plesk Web-Backend? I'd like to use it for central control of an automated backup task. What I want to avoid is set up 50 seperate cron jobs, one for each domain specifically.
Yes - I'm lazy, why are you asking? ;)

Any help would be greatly appreciated.
 
Each domain you create gets assigned to a "Service-Paket" - don't know whats it called in english exactly.
1.jpg

When you create one of these you can specify the features it contains (for example you could create a basic, advanced and professional package and assign them to the corresponding domain / client).
3.jpg

To elaborate on my example: I was wondering if you could assign a cron job to the professional package, so that this cron job would automatically run on every domain, that is assigned to the corresponding package.

Basically: I just want to know if it's possible to set up one backup cron job that runs for multiple domains.
 
There is no easy solution for this. You'll need to write an SQL command that exports all domains from the psa database that are assigned to a certain service plan to a text file and then use a while-loop in shell script to work through that file line by line and use the paths and/or domain names as parameters for commands that you want to execute for each of these entries. it requires a lot of shell scripting work and you need to dive into the psa table structure to figure out where to collect all the data you need, specificially from which tables and how to join them to get exactly the list of domains that you want.
Maybe a good start is How to export a domains list with status, service plan, disk usage, traffic and expiration date to Excel file?
 
Back
Top