Do not make backups for user with over x usage

Salmus

Verified User
Joined
Feb 15, 2008
Messages
39
It is possible to exclude from system backups, users with more than X MB in disk usage ?
 
What Jeff means, is not within the DA Control Panel, and not with any other DA specific tools.

However, you certainly could setup a backup script using your command-line (access via SSH). Something like RSync could be used and you could check folder sizes using BASH. The script could be then added to your crontab and run periodically (daily for example).

When you write a backup script, you need to backup "everything" about the user, not just the /home/<user> folder. For example, there are databases, log files and custom settings too.

It may be worth asking for DA to add admin_backup to the API - that way custom backup scripts can do things like testing <user> folder size and run the individual backup. Then all you have to do is write a simple BASH script, and the DA backup does all the hard work.
 
It may be worth asking for DA to add admin_backup to the API - that way custom backup scripts can do things like testing <user> folder size and run the individual backup. Then all you have to do is write a simple BASH script, and the DA backup does all the hard work.

True but you really don't need the DA API. All you are doing in the end is writing to the /usr/local/directadmin/data/task.queue file.

Writing this will start backing up all users within the next minute:
action=backup&local_path=/home/admin/admin_backups&owner=admin&type=admin&value=multiple&when=now&where=local&who=all

Go to the admin backups section and select a few users to backup now and then look at the task.queue file before the cronjob runs and you will see the proper format for individual users.

As ranz said use a script of some sort to check the size of the user and determine if you want that user to be backed up. After the script has a list of users then you can have it write the command to task.queue.
 
Back
Top