cPanel & WHM Version 98 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!
This object is in archive! 

Backup all new accounts by default

Marc Warne shared this idea 5 years ago
Completed

When new accounts are created, the admin needs to manually configure these to be backed up. This leads to overhead and likely mistakes resulting in accounts not being backed up.

It should be possible for either of the following:

1. All users are backed up by default (if none are explicitly configured under 'Select users' in the backup configuration page); or

2. New accounts will have their backup switched to 'On' automatically.

This is mentioned in the original request at https://features.cpanel.net/topic/add-mass-selection-of-users-to-backup-user-selection but doesn't seem to have been picked up.

Best Answer
photo

I'm going through a lot of our historical feature requests to make sure that they're still valid requests. It looks like this one may have been resolved internally, without an update to this request. Currently if I enable the backup system, and then create a new account, backups for that user are enabled. Can you confirm that this is true on your system at this point?

Replies (3)

photo
1

There is actually an easy way to do this for the new backups using the wwwacct hook.


For example if you are running 11.52 you could do the following steps to automatically enable the backups for new accounts.


=== Root access required , enables the default backup system for new accounts automatically.

1. touch /scripts/postwwwacct

2. chmod 755 /scripts/postwwwacct

3. vim /scripts/postwwwacct

4. add the following code :


  1. #!/usr/local/cpanel/3rdparty/bin/perl
  2. print "Enabling Backups for New user account \n";
  3. my %OPTS = @ARGV;
  4. my $username = $OPTS{'user'};
  5. system("whmapi1 toggle_user_backup_state user=$username legacy=0 > /dev/null");


5. Save and exit the file


Now when new accounts are created using cPanel's wwwacct api, it will automatically set the backup option for you. To make it easier you could also just download the attached file and then copy it to /scripts/postwwwacct on your cPanel server.


(Don't forget to make it executable with command: chmod +x /scripts/postwwwacct )


Keep in mind this does use the 11.52 style command-line api tool. If you are running older than 11.52 you will need to create a different script to call these functions correctly.


All the hooks and api information can be obtained from the cPanel documentation pages.

https://documentation.cpanel.net/display/SDK/Guide+to+Standardized+Hooks+-+Script+Hooks

https://documentation.cpanel.net/display/SDK/WHM+API+1+Functions+-+toggle_user_backup_state


Hope this helps :)

photo
2

I'm going through a lot of our historical feature requests to make sure that they're still valid requests. It looks like this one may have been resolved internally, without an update to this request. Currently if I enable the backup system, and then create a new account, backups for that user are enabled. Can you confirm that this is true on your system at this point?

photo
1

Oh, that's nice! Yes, I confirm it seems to set new accounts to Backup = On. Great!

photo
1

Fantastic! I'm going to mark this as complete, then.

Replies have been locked on this page!