Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup / Move script #2

Open
FalkoInc opened this issue Jun 19, 2022 · 0 comments
Open

Backup / Move script #2

FalkoInc opened this issue Jun 19, 2022 · 0 comments

Comments

@FalkoInc
Copy link
Contributor

FalkoInc commented Jun 19, 2022

Here is what I started for the backup /  move script
I suggested to add 2 variable for storage to the environment:

  1. server_storage (for server specific files)
  2. shared_storage (for multi server files e.g. www and vmail)use them in the volume declaration like volumes:
`["$server_storage/backup:/var/backup/"] or ["$shared_storage/backup:/var/www/"]`

> ###     Initial Installation only, execute Backup Script inside the Container before shutting down
>          volumes: ["/data/panel/backup:/var/backup/"]
> ###     Make Data persistent, execute Move Script on host before starting containers    
> #         volumes: ["/data/panel/backup/:/var/backup/", "/data/panel/var/lib/amavis/:/var/lib/amavis/","/data/panel/etc/amavis/:/etc/amavis/", "/data/panel/etc/letsencrypt/:/etc/letsencrypt/", "/data/panel/etc/apache2/sites-available/:/etc/apache2/sites-available/", "/data/panel/etc/apache2/sites-enabled/:/etc/apache2/sites-enabled/", "/data/panel/usr/local/ispconfig/:/usr/local/ispconfig/", "/data/panel/etc/cron.d/:/etc/cron.d/", "/data/panel/etc/bind/:/etc/bind/", "/data/panel/var/vmail/:/var/vmail/", "/data/panel/var/www:/var/www/"]   

     

Backup script on container

cp -r --parents /var/lib/amavis/ /var/backup/
cp -r --parents /etc/amavis/ /var/backup/
cp -r --parents /etc/letsencrypt/ /var/backup/
cp -r --parents /etc/apache2/sites-available/ /var/backup/
cp -r --parents /etc/apache2/sites-enabled/ /var/backup/
cp -r --parents /usr/local/ispconfig/ /var/backup/
cp -r --parents /etc/cron.d/ /var/backup/
cp -r --parents /etc/bind/ /var/backup/
cp -r --parents /var/vmail/ /var/backup/
cp -r --parents /var/www/ /var/backup/

On host move script

cd /data/panel/backup/
sudo cp -r --parents var/lib/amavis/ /data/panel/
sudo cp -r --parents etc/amavis/ /data/panel/
sudo cp -r --parents etc/letsencrypt/  /data/panel/
sudo cp -r --parents etc/apache2/sites-available/ /data/panel/
sudo cp -r --parents etc/apache2/sites-enabled/ /data/panel/
sudo cp -r --parents usr/local/ispconfig/ /data/panel/
sudo cp -r --parents etc/cron.d/ /data/panel/
sudo cp -r --parents etc/bind/ /data/panel/
sudo cp -r --parents var/vmail/ /data/panel/
sudo cp -r --parents var/www/ /data/panel/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant