Forum OpenACS Development: Re: execute bash commands on TCL script

Collapse
Posted by Rodrigo Proença on
Hi Iuri,

I wrote TCL scripts to perform the backup of the database using the web as well:

if [catch {
set database_name [db_get_database]
[exec pg_dump -O -f $dest/db.dmp $database_name ]
} errmsg] {
set msg "Error: $errmsg"

} else {
set msg "Done"
}

...

if [catch {
[exec gzip -9 $dest/db.dmp]
} errmsg] {
append msg "Error: $errmsg"
} else {
append msg "Done"
}

It looks like what you want?

Collapse
Posted by Iuri Sampaio on
Precisely!

with little amends i will be fine

Thanks Rodrigo

Collapse
Posted by Rodrigo Proença on
Iuri,

Package monitoring has a good example too. It runs the command line (TOP) and inserts each response row in database.