Results 1 to 4 of 4

Thread: User backups command line / migration script challenges

  1. #1
    Join Date
    Oct 2018
    Posts
    2

    User backups command line / migration script challenges

    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 beng 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.

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,569

  3. #3
    Join Date
    Oct 2018
    Posts
    2
    Quote Originally Posted by zEitEr View Post
    Thank you but this is not what i'm looking for. It's the general idea but I need to tweak the options somehow...

    This is also not really what i'm looking for . I appreciate the help though!

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,569
    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 beng 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 "/usr/local/directadmin/data/task.queue", 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •