• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx

  • We are developing a new feature in Plesk that will help you promote your websites or business on social media. We want to conduct a one-hour online UX test to present the prototype and collect feedback. If you are interested in the feature, please book a meeting via this link.
    Thank you in advance!
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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