Daily backup and restore of DA accounts.

etegration

Verified User
Joined
Jan 22, 2004
Messages
103
Location
Singapore
There's is an option in backup. " - Cron Schedule " at http://serverip:2222/CMD_USER_BACKUP

1. Will it be possible to tell DA to do the backup everyday at a specific time of the day using Crontab?

Backup will then be sync between 2 servers using rsync or other means, still working on this.

2. Will it be possible to tell DA to restore the backup on another server automatically? Difference will be the IP to use. When manually restoring, "Step 2: Select IP", possible to tell DA to restore and use a specific IP from my drop down list using crontab?

When restoring manually, tons of error seems to be appearing. For example:

Error 1

Domain domain1.com Created

Domain Created Successfuly

Unable to read /home/domain1/backups/backup/domain1.com/email/passwd : Can't get a lock on /home/domain1/backups/backup/domain1.com/email/passwd

Also happen to autoresponder.conf, aliases, vacation.conf, email.conf in the same directory. (/home/domain1/backups/backup/domain1.com/email/)

Error 2.

Unable to restore database domain2_warranty.sql to domain2_warranty : ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
sh: line 2: --user=domain2: command not found

I suppose the above error was de to a change in passwords? But it's suppose to just re-create the user and all his details on server 2 including his database etc, the user does not know of the 2nd server in the first place thus password changed wasn't done by them???

Please advise.
 
Hello,

1) Yes, it does (/var/spool/cron/diradmin)

2) Yes.. I'm not positive on the syntax, but it should be something like this:
Code:
action=restore&type=reseller&value=multiple&owner=bob&where=local&when=now&ip_choice=select&ip=1.2.3.4&select0=george.tar.gz&select2=eddy.tar.gz.. [ftp_ip=1.2.3.4&ftp_username=asdf&ftp_password=base64enc&ftp_path=/]
Note that the stuff between [ and ] are optional. If you use it, you need to ste where=ftp.

Error 1) Extract the file manually and make sure those files are actually there.

Error 2) That one is a bit odd for a few reasons. For one, the user is "da_admin", not root.. also, the password is passed, so I'm not sure why it's asking for it. The sh error which is trying to run "--user" as a command leads me to believe there is a value or password being passed with a newline character, putting the command on 2 lines (and 2 commands), which would explain the rest of the errors.. I couldn't say how/why that's happening.

John
 
DirectAdmin Support said:
Hello,

1) Yes, it does (/var/spool/cron/diradmin)

2) Yes.. I'm not positive on the syntax, but it should be something like this:
Code:
action=restore&type=reseller&value=multiple&owner=bob&where=local&when=now&ip_choice=select&ip=1.2.3.4&select0=george.tar.gz&select2=eddy.tar.gz.. [ftp_ip=1.2.3.4&ftp_username=asdf&ftp_password=base64enc&ftp_path=/]
Note that the stuff between [ and ] are optional. If you use it, you need to ste where=ftp.

Error 1) Extract the file manually and make sure those files are actually there.

Error 2) That one is a bit odd for a few reasons. For one, the user is "da_admin", not root.. also, the password is passed, so I'm not sure why it's asking for it. The sh error which is trying to run "--user" as a command leads me to believe there is a value or password being passed with a newline character, putting the command on 2 lines (and 2 commands), which would explain the rest of the errors.. I couldn't say how/why that's happening.

John

thanks John, i'll give the remote FTP backup a try.
 
GXX said:
quick question, can we specify a different port for FTP transfer?

i have a backup server, but it does not listen on the default port of 21. Can we set that option somewhere for backup?

Exactly what i wanted to ask, i am planning to have 3 copies of a single backup and one copy is going to be FTP-ed to a remote location. The remote location is running IIS 6 with FTP enabled and it listens to another port, possible to tell DA to log into that?
 
DirectAdmin Support said:
Hello,

1) Yes, it does (/var/spool/cron/diradmin)


Is it true that is for example i have ran the backup once and create say a backup for an account named test, a file test.tar.gz will be created in /home/admin/user_backups/

If this file exists, i run the backup again, it will not overwrite that test.tar.gz bt will create test1.tar.gz am i right?
 
Running backups as a reseller I believe it will overwrite the files. I think it only does this if a user backs up his own files, but I'm not entirely sure.

While your waiting for Support to respond regarding the ftp port you could try adding the port to the end of the address (e.g. 127.0.0.1:21) or specifying another thing like since it says ftp_username and ftp_password etc. why not try puttin gin ftp_port=#
Just some things to help pass the time with :p
 
Something like this, I doubt it will work but who knows? Might need to be a requested feature for DA.

Code:
action=restore&type=reseller&value=multiple&owner=bob&where=local&when=now&ip_choice=select&ip=1.2.3.4&select0=george.tar.gz&select2=eddy.tar.gz.. [ftp_ip=1.2.3.4&[b][color=red]ftp_port=21[/color][/b]&ftp_username=asdf&ftp_password=base64enc&ftp_path=/]
 
The FTP function for backups is actually implemented with a PHP file (it's on the forums somewhere). Search for SFTP I think and it should come up.

You might want to try here first:
/usr/local/directadmin/scripts

HTH,
Matt :)
 
You may be able to edit the PHP script to act differently depending on which user it's for.

Matt
 
Back
Top