• 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 Backup Shell Script

Taxick

New Pleskian
Hi :)

I'm looking for a shell script, that can make a backup of a dir outside the normal Plesk dirs..

It has to move the backup to a remote server, and it needs to be done with FTP or FTPS!

The script also needs to remove old backups after 7 days!

I will run with crontab, every night.

Anyone that can help me with this?

Regards

Thomas
 
Hi :)

I'm looking for a shell script, that can make a backup of a dir outside the normal Plesk dirs..

It has to move the backup to a remote server, and it needs to be done with FTP or FTPS!

The script also needs to remove old backups after 7 days!

I will run with crontab, every night.

Anyone that can help me with this?

Regards

Thomas
Depending on the size of the data you could simply copy the path that you want to backup into a subscription directory every night before the Plesk backup starts. You might then not have a separate backup of it, but you'll have a backup of it within the Plesk backup and you save the hassle of developing an extra script for that. Because using an extra script goes along with surveillance: Did the script run? What errors occured during a backup? Etc. It might be much easier to simply do a copy with "cp -R" through a cronjob and then let Plesk backup the copy as a part of a subscription directory.
 
Hi :)

Thanks for you answer :)

#2 Maybe I will contact you!

#3. I have a docker image, that runs Ghost Blog. The files a located in /var/www/vhosts/ghost-blog - But its not included in the backup from docker.. I don't know wry!

Plesk take backup to an extern backup location every night.. But as I mention before it doesn't include my ghost backup

Btw the plesk that takes a backup of my domain with more, working fine

Regards

Thomas
 
Last edited:
Maybe because you have installed it with root?
What is the owner of the directory/files?

Also: if the needed files are in a normal vhost they ALL should be backupped aswell, unless they are "linked" with symlinks?
Have you checked if they may are excluded by the "exclude" option?

I would stick with the standard Plesk-Backup option and rather try to make it work out of box instead of running own Bash-Scripts.
 
Hi :)

Thanks for your answer.

I have tried to change the files with: "chown -R futurenode : psaserv ghost-blog/"

But anytime I reboot the docker image, it changes the permission back to taxick : psaserv

Before i restart the docker image:

drwxr-xr-x 2 futurenode psaserv 4096 Nov 4 03:20 apps
drwxr-xr-x 2 futurenode psaserv 4096 Nov 8 17:39 data
drwxr-xr-x 4 futurenode psaserv 4096 Nov 7 13:49 images
drwxr-xr-x 2 futurenode psaserv 4096 Nov 5 10:30 logs
drwxr-xr-x 2 futurenode psaserv 4096 Nov 5 18:30 settings
drwxr-xr-x 3 futurenode psaserv 4096 Nov 8 16:18 themes

after i restart the docker image:

drwxr-xr-x 2 taxick psaserv 4096 Nov 4 03:20 apps
drwxr-xr-x 2 taxick psaserv 4096 Nov 8 17:39 data
drwxr-xr-x 4 taxick psaserv 4096 Nov 7 13:49 images
drwxr-xr-x 2 taxick psaserv 4096 Nov 5 10:30 logs
drwxr-xr-x 2 taxick psaserv 4096 Nov 5 18:30 settings
drwxr-xr-x 3 taxick psaserv 4096 Nov 8 16:18 themes

I have tried to take a backup before and after I restart the docker image. But files are not included in the backup

Here is a picture of backup settings:

2020-11-09_10-47.png

Regards

Thomas
 
Last edited:
Back
Top