Can we change admin_backups Folders

nicsopon

Verified User
Joined
Jul 4, 2006
Messages
98
By default, DA give admin backup to
/home/admin/admin_backups

Where I can modify it to backup to another Backup HD like /back_disk/admin_backups permanently.

Besides, I would like to add some codes to that script to

1. change the Folder name to /backup_disk/admin_backups/Backup-Month-Day
2. Create a new admin_backups folder for the new day backup.

And also how to change the restore folder to match the required backup folder too. This will be faster than making Copy to a new Folder.

Please help
 
Last edited:
I believe it's controlled by a script; I vaguely remember seeing it on these forums recently.

Jeff
 
Hello,

DA will remember the path, I believe you specify it in the restore section, and click "Update Files", and it will stick and be shown in the Backup path field.

Regarding creation of per-day repositories:
http://help.directadmin.com/item.php?id=146

John

That url is almost the answer. Anyway the path is still default and using FTP is not the solution as the backup folder is still stick under /home/ only.

In Admin Backup/Transfer we can specify Where to store the backup and restore from folder manually. I can put it where I want. But I have to do it manually every time I want to do admin backup. Is it possible to change it's default location to what I want?

Is user_backup_post.sh will work with admin backp?

The user_backup_post.sh will work after each user is created. This will slow down the backup process if I run cp the created file to another folder and the backup is running the next users.

Is there any scripts to run after the whole backup process is completed. I just want to add this short command:

#cd /backup_harddisk/admin/
#mv admin_backups July-28
#mkdir admin_backups
#chwon admin:admin admin_backups

Thanks
 
Let's see, where might that setting be located? Let's find out:

Code:
[root@super2 ~]# cd /usr/local/directadmin/
[root@super2 directadmin]# grep -r admin_backups ./
./data/admin/backup.conf:local_path=/home/admin/admin_backups

There you go. Edit /usr/local/directadmin/data/admin/backup.conf. Easy to find. Even faster than searching the forum.
 
Hello,

You can just change the path, it is a variable, so no need to run any script. The user_backup_post.sh is run after any DA tar.gz backup file is created, at any Backup Level (System Backup not included). It will slow down the backup process if you're moving files to different partitions.

So changing the path would be the simplest solution, either through the interface, or by the file floyd pointed out (same thing), and won't slow anything down since the backup is being created right on the end-point partition.

Another way is to create a symbolic link to where you want to go so you don't have to change any settings (but the variable is there in DA for that reason anyway).

John
 
Thanks for all reply

I start to make backup as my plan. I can success with Backup Path Modification but fail with the "/usr/local/directadmin/scripts/custom/user_backup_post.sh" script.

I fix the file "/usr/local/directadmin/data/admin/backup.conf" and change the path line to
Code:
local_path=/xxxx/admin/admin_backups
and it shows as expect.
(THANKS TO "FLOYD")

I modify /usr/local/directadmin/scripts/custom/user_backup_post.sh to look like this :
Code:
day=`date '+%b-%d'`
mv /xxx/admin/admin_backups/*.tar.gz /xxx/admin/$day/.
I create a cron to run before backup every day to creat a $day folder for this moving.

Anyway, after the backup is finished, this error is in the message box

<a href%3D"/CMD_FILE_MANAGER/backups/user.admin.iphost.tar.gz">Click Here to Download the Latest Backup - user.admin.iphost.tar.gz</a><b>Script output</b>: /usr/local/directadmin/scripts/custom/user_backup_post.sh

When I follow the steps i found that the message log is created before the backup files is created. Is it possible the the user_backup_post.sh script is run before Backup File is completely copy to the specify folder (/xxxx/admin/admin_backups).

I may modify user_backup_post.sh script in the wrong way. Please inform how to make it work properly.

Thanks & Best Regards
 
Back
Top