• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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