1
0

createMirror.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * bookmark management
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE
  7. *
  8. * You should have received a copy of the
  9. * COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
  10. * along with this program. If not, see http://www.sun.com/cddl/cddl.html
  11. */
  12. /**
  13. * this script calls via exec() the httrack command.
  14. * to use this you need http://www.httrack.com/ installed
  15. */
  16. ini_set('error_reporting',-1); // E_ALL & E_STRICT
  17. ini_set('display_errors',false);
  18. ini_set('log_errors',true);
  19. ini_set('log_errors_max_len',"10M");
  20. ini_set('error_log','./error.file');
  21. $link = false;
  22. $to = false;
  23. $command = false;
  24. $path = dirname(__FILE__).'/';
  25. if(isset($_POST['link'])) $link = trim($_POST['link']);
  26. if(isset($_POST['saveTo'])) $to = trim($_POST['saveTo']);
  27. if(!empty($link) && !empty($to)) {
  28. $command = "nohup /usr/bin/httrack -T3 -F'Mozilla/5.0' -r2 -* +*.gif +*.jpg +*.png +*.css +*.js '".$link."' -O ".$path.$to.'/ 1>&2 > /dev/null &';
  29. $run = exec($command);
  30. }
  31. ?>