Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic backup is this possible
#1
I've been jusing ehcp now for a half year. I'm very happy with this control panel, the control panel can do anything what you expect of a paid control panel like cpanel, plesk. Three days ago I have installed version 0.29. It's working fine. But I was wondering if it is possible to make a automatic backup. Now you can only backup by hand. Can I do this with crontabs? So yes, what command must I use? Or is this an idea for a next version?



Restored from old drupal forum, for user uid:1238 username:Arens
You may reset your password to access your new account here.
Reply
#2
Hi,
congratulations for your good experience with ehcp.
I just wrote a small php program that does what you want,
copy following code in a php file, save, then, you may run that file in a cron job,
if you have any further difficulty/help, let me know..

<code>
#!/usr/bin/env php
<?php

include_once("config/dbutil.php");
include_once("config/adodb/adodb.inc.php"); # adodb database abstraction layer.. hope database abstracted...
include_once("classapp.php"); # real application class



$app = new Application();
$app->requirePassword=false;
$app->initialize();

$backupname='mybackup'.date('YmdHmi');
$whattobackup="files,mysql"; # you may also include ehcp's files here..

$app->daemonBackup('',$backupname,$whattobackup);

echo "hope finished... Smile";
?>
</code>

Restored from old drupal forum, for user uid:1238 username:Arens
You may reset your password to access your new account here.
Reply
#3
did this solve your need ?

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply
#4
Sorry for the late reaction, I was very busy last week. Thank you for your fast reaction, this is what i was searching for. Now I go try to put this in crontabs. On this moment I don't now how but I search for it.

Thank you!


Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply
#5
write that code in a php file, for ex ehcpbackup.php

then on console,
chmod a+x ehcpbackup.php

then,
crontab -e

then write/add following line into crontab
*/60 * * * * /pathto/ehcpbackup.php

replace path with real one.
thats all.

Restored from old drupal forum, for user uid:1238 username:Arens
You may reset your password to access your new account here.
Reply
#6
Now when the backup is finished I get this error

executing command: tar -zcvf mybackup20090306130357.tgz mybackup20090306130357
tar: mybackup20090306130357.tgz: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
tar: mybackup20090306130357: Cannot stat: No such file or directory
tar: mybackup20090306130357.tgz: Cannot write: Broken pipe
tar: Error is not recoverable: exiting now

Warning: filesize(): stat failed for mybackup20090306130357.tgz in /var/www/vhosts/ehcp/classapp.php on line 1526


pwd is:/var/backup
total 229352
-rw-r--r-- 1 root root 14897637 2009-02-05 21:50 backup2009-02-05_09-49-41.tgz
-rw-r--r-- 1 root root 102399486 2009-02-07 19:17 backup2009-02-07_07-16-12.tgz



executing command: rm -rvf mybackup20090306130357
finished backups..waiting for 5 sec to let you check.hope finished... SmilePress ENTER to continue and close this window.

What is this can you help me


Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply
#7
normally, ehcp daemon does backup.
if you see this error while you do: tail-f /var/log/ehcp.log

then, your ehcp daemon does not run as root user.
make sure that your ehcp daemon is running as root.

go to console
sudo /etc/init.d/ehcp restart

then repeat/retry backup

if you do backup/restore from cron jobs,
then, you should put your cron in cron of root.


Restored from old drupal forum, for user uid:1238 username:Arens
You may reset your password to access your new account here.
Reply
#8
Now I get this back

administrator@webserver:~$ tail -f /var/log/ehcp.log
)
Array
(
)


ehcp V.0.25- Daemon loop number:291
-----------daemon suspended for 10 sec ---------
trying re-connecting to mysql db..
reconnect successfull.

Is this good?
Does he run as root?

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply
#9
i cannot understand from that.
to understand:
ps aux | grep index | grep root

if you see like:
root@yenisunucu:~# ps aux | grep index | grep root
root 9411 0.0 0.6 35020 11688 ? S 19:37 0:00 php index.php daemon


then it is root
if you dont see "php index.php daemon" then, it is not..


Restored from old drupal forum, for user uid:1238 username:Arens
You may reset your password to access your new account here.
Reply
#10
I get back this

root 5703 0.0 1.2 27288 12332 ? S 16:09 0:00 php index.php daemon

Then it is root

What is wrong then

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply


Forum Jump:


Users browsing this thread: 8 Guest(s)

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping