PDA

View Full Version : Command line - force DA update?


Dixiesys
04-21-2004, 09:43 AM
What would be the command line way of forcing a directadmin update? Rather than logging into each server manually I'd rather send a global shell command to each server in one swoop I know it's something like echo <something> >> something/dataskq or something like that

Thanks :D

DirectAdmin Support
04-21-2004, 10:39 AM
Hello,

Update License:
action=update&value=license

Update DA:
action=update&value=program

While we're at it, let's do the rest ;)

Nightly Tally:
action=tally&value=all

Tally one User:
action=tally&value=john&type=user

Tally a Reseller (and his users)
action=tally&value=joe&type=reseller

Check to turn on/off vacation messages:
action=vacation&value=all

Monthly Reset:
action=reset&value=all

Reset one User:
action=reset&value=john&type=user

Rewrite the user httpd.conf files with the templates
action=rewrite&value=httpd

Check the license to see if it needs updating and try to get a new one if it does:
action=check&value=license

Run a backup:
action=backup&id=1&owner=bob
(owner is the reseller)

Extra less important commands:

Recache the 'Show all Users' page:
action=cache&value=showallusers

Recache user bob in the 'Show all Users' page:
action=cache&value=showallusers&user=bob
action=cache&value=showallusers&select0=bob&select1=fred&...

Recache the safemode page:
action=cache&value=safemode

Recache domain.com on the safemode page:
action=cache&value=safemode&domain.com=user
action=cache&value=safemode&domain.com=user&domain2.com=user2


There are a few others that were created just for 1 time use during an update, but they're reallly not too exciting ;)

John

hostpc.com
04-21-2004, 11:41 AM
Wow, Great resource thread. Thanks John!

What would the ID from this one be?

Run a backup:
action=backup&id=1&owner=bob
(owner is the reseller)

id=1 - does that change with every reseller?

Thanks

DirectAdmin Support
04-22-2004, 02:12 PM
Hello,

Each backup has an ID. Backup IDs are global for everyone, so no 2 resellers will have the same ID. You can see the backup_crons.list file to view who's backups have what ID here:

/usr/local/directadmin/data/admin/backup_crons.list

It was changed to the ID method because cron couldn't handle the excessively long strings that are needed when a Reseller specifies to backup all 50 users at once :)

John

Fenix
04-19-2007, 12:47 AM
May i can use

Rewrite the user httpd.conf files with the templates
action=rewrite&value=httpd


for one user?

DirectAdmin Support
04-19-2007, 12:50 AM
Yes:echo "action=rewrite&value=httpd&user=username" >> /usr/local/directadmin/data/task.queueJohn

Fenix
05-10-2007, 04:50 PM
I create script
<?php
$dira2="/usr/local/directadmin/data/users/$_SERVER[USER]/domains/";

$fw = fopen("$dira2/$domain.cust_httpd","w");
$fw1 = "$dira2/$domain.cust_httpd" ;
$cont="php_admin_flag safe_mode off"; //for example
fwrite($fw, $cont);
fclose($fw);
chmod($fw1,0600);

$fw = fopen("/usr/local/directadmin/data/task.queue","a+");
$cont="action=rewrite&value=httpd&user=$_SERVER[USER]";
fwrite($fw, $cont);
fclose($fw);
?>

All files created with good content
but httpd.conf for user NOT rewrited with content from $domain.cust_httpd

What wrong?