Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backup.php #104

Open
marcbth opened this issue Oct 26, 2019 · 3 comments
Open

backup.php #104

marcbth opened this issue Oct 26, 2019 · 3 comments

Comments

@marcbth
Copy link

marcbth commented Oct 26, 2019

backup.php

`<?php
$from = "/mnt/hdd/B";
$to = "/media/usb0/Backup";
$skip = array('some_file.php', 'somedir');
copy_r($from, $to, $skip);

function copy_r($from, $to, $skip=false) {
global $skip;
$dir = opendir($from);
if (!file_exists($to)) {mkdir ($to, 0775, true);}
while (false !== ($file = readdir($dir))) {
if ($file == '.' OR $file == '..' OR in_array($file, $skip)) {continue;}

    if (is_dir($from . DIRECTORY_SEPARATOR . $file)) {
        copy_r($from . DIRECTORY_SEPARATOR . $file, $to . DIRECTORY_SEPARATOR . $file);
    }
    else {
        copy($from . DIRECTORY_SEPARATOR . $file, $to . DIRECTORY_SEPARATOR . $file);
    }
}
closedir($dir);

exec ("find /media/usb0 -type d -exec chmod 0777 {} +");
exec ("find /media/usb0 -type f -exec chmod 0777 {} +");

}

//$creport = 'Backup OK';
// echo '<script type="text/javascript">alert("'.$creport.'");</script>';

header('Location: index.php');
exit;

?>

`

Originally posted by @marcbth in #103 (comment)

@marcbth
Copy link
Author

marcbth commented Oct 26, 2019

Hello Artur,

I added a menu item in settings.

backup.

solved very simply at the moment, maybe as a suggestion:

/usr/bin/local/fullbackup.sh

`
#!/bin/bash
/usr/bin/rsync -aHXrtv --del --modify-window=2 /mnt/hdd /media/usb0

force sync of files to disk before unmounting

/bin/sync

unmount the backup disk

/bin/umount /media/usb0
`

@ArturSierzant
Copy link
Owner

Hi,
I can't find it in your last commit. Have you give it up?

@marcbth
Copy link
Author

marcbth commented Nov 4, 2019

Hi,
sorry, did not give it up. will put it online tomorrow.
for me some things in the settings deleted and backup added.
synonymous have the standard skin changed a little (there are no more edges in the cover presentation, etc.)

Hope you can do something with it.

cliff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants