Backup only users data from directadmin by ssh

karoldz

New member
Joined
Aug 4, 2008
Messages
1
Hi,
My server is only available by rescue mode where are stored data with directadmin users, domains, email and etc.. I must do this by ssh. Can anyone help me?
 
You can also run the Admin Backup while in rescue mode after a chroot. Be sure to start mysql first.
 
Isn't rescue mode single user? How can you run mysql in the background in single user mode?

Or am I missing something?

Jeff
 
How can you run mysql in the background in single user mode?

I don't see how the two are related. And no resue and single user are not the same thing exactly but they may be virtually the same thing.

Rescue is when you boot from the cd. Single user you modify grub when booting from the hard drive. When all is said and done the result may be the same. I don't know.

What I do know is this and I have posted this before: Boot from the cd into rescue mode. The cd should mount the linux partition in /mnt/sysimage. If not then you may have bigger problems. You can try to manually mount the partition. chroot /mnt/sysimage This also assumes everything you need is under the / partition. Start mysqld.

Code:
echo "action=backup&local_path=/home/admin/admin_backups&owner=admin&type=admin&value=multiple&when=now&where=local&who=all” >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq

All the users data will be backed up in /home/admin/admin_backups

This works. I have done it many times.
 
Last edited:
After chroot to /mnt/sysimage I started mysqld as normal. /etc/rc.d/init.d/mysqld start

You can start all services from there. I have even started directadmin and sshd and started the network and was able to get in remotely from my office and ran directadmin.

I did this on a machine that for some unknown reason to me would not boot. But everything seemed to work correctly booting into rescue mode and chroot.

I have since used this method to recover other machines.
 
Thanks, Floyd. I'd always assumed that you couldn't run daemons in recover mode... perhaps because I've always thought that recover mode was single-user mode, and I've always thought you couldn't run daemons in single-user mode.

I've learned something today... mainly that when I ass-u-me I make an (first-part) out of (second-part) and (third-part).

:D

Jeff
 
And just so you know I really ain't all that smart. I just try stuff. I just learned this myself a few months ago.

One day I had to boot with the cd to try to recover some data because the machine became unbootable for some reason. Most of the time I don't know how to fix stuff so I really just want to recover the data and move on. I know how long it will take me to put together a new machine and put the data back on it. Trying to fix an unbootable machine for me is an unknown.

Anyway ... I had always seen something in the rescue process something about chrooting to /mnt/sysimage. When I finally figured out what chroot was I decided to try it. So I "chroot /mnt/sysimage" I then realized I was seeing the files as if I had booted normally. Ok great but how does this help me recover files. It doesn't really at this point. It saves me from having to type in two directory levels. I don't have to type /mnt/sysimage anymore. I can access /home instead of /mnt/sysimage/home. Big whoop.

I knew that the admin backup wrote to the task queue. So I wondered what would happen if I did that from the command line. I went to another machine and figured out exactly what was being written and so I wrote the same to this other machine and waited. Nothing happened. Of course, crond was not running. So I started crond /etc/rc.d/init.d/crond start. I waited and the backups began to get created.

I transferred the backups and thought all was great. Not so. None of the databases got backup. of course that is because mysqld was not running. So I went back and started the whole process over again and this time started mysqld before starting the backups. Later I figured out how to run the task queue without cron.

Anyway I learn by just trying stuff. I have really messed up some stuff learning this way but I always try on stuff that really doesn't matter anyway. "Let me do this and see what happens."

Most of the time when I post stuff here is stuff that I have actually done and not stuff I only think will work.
 
hi dear
echo "action=backup&local_path=/home/admin/admin_backups&owner=admin&type=admin&value=multiple&when=now&where=local&who=all” >> /usr/local/directadmin/data/task.queue
how use this command for backups by ftp transfer to another server ?
 
Run it from DA like you normally would and then see what gets written to the file /usr/local/directadmin/data/task.queue
 
Back
Top