User backups command line / migration script challenges

sonny88

New member
Joined
Oct 15, 2018
Messages
2
Hi Guys,

I'm working on a (bash) script which does the following:

- Create reseller(s)/user(s) backup in /home/admin/admin_backups/
- Rsync backups to new server
- Import reseller(s)/user(s) backup on new server (with the new servers ipaddress)
- Rsync user(s) homedir after import
- Import user(s) database(s) after import (direct mysql dump)

I want to exclude the following (just like unchecking the boxes in Admin Backup/Transfer):

- Domains Directory
- E-Mail Data
- Database Data

I got this working on one server by capturing the the request in Chrome:

action=backup&append%5Fto%5Fpath=nothing&database%5Fdata%5Faware=yes&email%5Fdata%5Faware=yes&local%5Fpath=%2Fhome%2Fadmin%2Fadmin%5Fbackups&option%30=autoresponder&option%31=database&option%32=email&option%33=emailsettings&option%34=forwarder&option%35=ftp&option%36=ftpsettings&option%37=list&option%38=subdomain&option%39=vacation&owner=admin&select%30=${USER}&type=admin&value=multiple&what=select&when=now&where=local

But on the next server it seems the options are different, so a much larger backup is created. Is there another way to create backups (and works on all DirectAdmin servers) from the shell which only contains:

- Subdomain Lists
- Ftp Accounts
- Ftp Settings
- Database Settings
- E-Mail Accounts
- E-Mail Settings
- Vacation Messages
- Autoresponders
- Mailing Lists
- Forwarders

I also have two other challenges:

1) I would like to create user backups without cronjobs. Is that possible? This way we can test if everything works (pre-sync), and then import cronjobs just before going live after the definitive migration. I can clear crontab.conf and crontab afterwards, but this is a 'dirty' workaround. Sometimes I still have cronjobs enabled for some users because my script was already finished but the user was still beïng imported in the background.

2) I want my script to (sleep) wait for the user import to complete before continuing doing other tasks. Do you guys have any suggestions for this? I can't rely on the ticket system in DirectAdmin or the DirectAdmin system.log.
 
Nobody but you know what you are looking for. ...


I would like to create user backups without cronjobs. Is that possible?

Check the link How to create a full backup of all accounts via the command line for this. It was already suggested. If it's not what you are looking for, kindly clarify your request.

This way we can test if everything works (pre-sync), and then import cronjobs just before going live after the definitive migration. I can clear crontab.conf and crontab afterwards, but this is a 'dirty' workaround. Sometimes I still have cronjobs enabled for some users because my script was already finished but the user was still beïng imported in the background.

I'm not even sure what are writing about here. If it's all about a server-to-server migration, then you rsync.... if you mean something else... clarify.


2) I want my script to (sleep) wait for the user import to complete before continuing doing other tasks. Do you guys have any suggestions for this? I can't rely on the ticket system in DirectAdmin or the DirectAdmin system.log.


add a task into "[FONT=&quot]/usr/local/directadmin/data/task.queue[/FONT]", and immediately run /usr/local/directadmin/dataskq in root console. It is also mentioned here How to create a full backup of all accounts via the command line
 
Hi,

I did:
/usr/local/directadmin/directadmin admin-backup --destination=/home/admin/admin_backups
but I don't see happening any backup.
Can I check any log or something to see why?

Thank you
 
Back
Top