• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Cronjob to backup email on one domain

JeffreyZ

Basic Pleskian
Seems if I want to back up a domain's emails to a remote server (3x a week) I might be able to accomplish that with a Scheduled Task / Cronjob? I have a weekly full domain backup from the Plesk scheduled backup. But I can only set one backup per client. So I'd like to backup email separately, several times a week.

I found this:

# /usr/local/psa/bin/pleskbackup –domains-name yourdomain.com –only-mail -v

But I'm looking to send to a remote FTP repository. Can it be done with "Scheduled Task"?
 
Use FTP options for /usr/local/psa/bin/pleskbackup if you need to use FTP repository (more details in /usr/local/psa/bin/pleskbackup --help).
And yes, you can use Scheduled Task for this command.
 
Thanks for your help Igor.

I'm getting an error
error: Can't upload file 'clients/xyz/domains/xyz.com/xyz.com_info_1410301244.xml' to ftp. Error code: 1
Runtime error: The backup failed with errors!

I don't know what error code 1 means and don't know where to look for a log file. Maybe the error is: can't connect to backup server? I was able to ping the server.

Format I used for my backup:
/usr/local/psa/bin/pleskbackup domains-name clientDomain.com --only-mail --prefix=XYZ --backup-password=1some2pass3 --output-file=ftp://<login>:<password>@<server>/<filepath>
 
You could try your command in passive mode ( string: "--ftp-passive-mode" ), to avoid connection issues.


You could as well use "rsync" and "ssh", if you would like to backup files/folders from server to server - you will find several work-arounds and tutorials using the search - string:

"rsync" "server to server"
 
Last edited by a moderator:
Thank you for that info. I tried the passive mode. Same result. I don't think Rsync is an option with my 3rd party data storage provider. Any idea where I'd find the error log?
 
Command:

locate psadump.log

... will print out the path for the specific logs.
 
Thank you!! I see it was a "couldn't connect to server" error. So I tried a test on a different server and was successful.
 
They specify that I use port 21 in their documentation. I am able to backup to this same account using Plesk Backup Manager.

the error portion of the migration log:

INFO: The return code was
No output on STDOUT were performed by the utility
No output on STDERR were performed by the utility
[2014-10-30 14:52:18.351| 1901] INFO: ENV[LANG]=en_US.UTF-8
[2014-10-30 14:52:18.351| 1901] INFO: Executing utility: /usr/local/psa/admin/sbin/backup_sign --sign-dump /usr/local/psa/PMM/tmp/backupSDOBlx/clientdomainfolder --session-path=/usr/local/psa/PMM/sessions/2014-10-30-145215.970
[2014-10-30 14:52:18.364| 1906] INFO: backup_sign started : /usr/local/psa/admin/sbin/backup_sign --sign-dump /usr/local/psa/PMM/tmp/backupSDOBlx/clientdomainfolder --session-path=/usr/local/psa/PMM/sessions/2014-10-30-145215.970
[2014-10-30 14:52:18.380| 1906] INFO: backup_sign finished. Exit code: 0
[2014-10-30 14:52:18.381| 1901] INFO: The utility executed with the return code 0
[2014-10-30 14:52:18.381| 1901] INFO: Ftp init url ftp://filesanywhere.com/clientdomainfolder
[2014-10-30 14:53:21.445| 1901] INFO: CurlError[f70f602b-65f6-432a-879b-a0b72fa16894]: Curl error: Couldn't connect to server [./ftp.cpp:418]
void plesk::tFtpConnection::UploadFile(const std::string&)
[2014-10-30 14:53:21.445| 1901] INFO: TransportError[78b77289-deec-441e-8f87-a375a944abc3]: Transport error: unable to put local file /usr/local/psa/PMM/tmp/backupSDOBlx/clientdomainfolder to clientdomainfolder: Curl error: Couldn't connect to server [./transport.cpp:706]
virtual void plesk::tRepositoryFtp::putFile(const std::string&, const std::string&)
[2014-10-30 14:53:21.446| 1901] INFO: pmm-ras finished. Exit code: 1
 
Back
Top