Skip to content

Commit

Permalink
Merge branch 'stable' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson authored Oct 17, 2018
2 parents eb43e2b + 876913b commit 7730082
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
10 changes: 1 addition & 9 deletions backup/backup_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,7 @@ function backup_controller()

if ((move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) && ($uploadOk == 1)) {

$fh = @fopen($import_flag,"w");
if (!$fh) {
$result = "ERROR: Can't write the flag $import_flag.";
} else {
fwrite($fh,"$import_script>$import_logfile");
$result = "Backup flag set";
}
@fclose($fh);

$redis->rpush("service-runner","$import_script $import_flag>$import_logfile");
header('Location: '.$path.'backup');
} else {
$result = "Sorry, there was an error uploading the file";
Expand Down
8 changes: 1 addition & 7 deletions emoncms-export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,7 @@ if [ $? -ne 0 ]; then
fi

# Append database folder to the archive with absolute path
tar -rv --file=$backup_location/emoncms-backup-$date.tar -C $mysql_path phpfina phptimeseries 2>&1
if [ $? -ne 0 ]; then
echo "Error: failed to tar mysql dump and data"
echo "emoncms export failed"
sudo service feedwriter start > /dev/null
exit 1
fi
tar -vr --file=$backup_location/emoncms-backup-$date.tar -C $mysql_path phpfina phptimeseries

# Compress backup
echo "Compressing archive..."
Expand Down
17 changes: 10 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## Emoncms backup export and import tool for backup and migration

* Export a compressed archive containing Emoncms Inputs, Feed data, Dashboards & config.
Expand Down Expand Up @@ -48,7 +47,10 @@ Follow on screen prompts, RasPi will shutdown when process is compleate. It can
git clone https://github.com/emoncms/backup.git
ln -s /home/pi/backup/backup/ /var/www/emoncms/Modules/backup

**Note: Ensure you are running the latest version of Emoncms on the Stable branch. [A change was merged on the 9th Feb 16 to Emoncms core](https://github.com/emoncms/emoncms/commit/e83ad78e6155275d7537104367b8d44ef63d78fe) that enables symlinked modules which is essential for backup module to appear in Emoncms**
**Note:

- Ensure you are running the latest version of Emoncms on the Stable branch. [A change was merged on the 9th Feb 16 to Emoncms core](https://github.com/emoncms/emoncms/commit/e83ad78e6155275d7537104367b8d44ef63d78fe) that enables symlinked modules which is essential for backup module to appear in Emoncms**
- As of June 18 Backup module requires Redis to set service runner flags

**If your running the older 'low-write' branch of Emoncms emonSD-17Jun15 or before then you won't be able to update to the latest version to enable symlinks, to get around this after installing the module browse to [http://emonpi/emoncms/backup](http://emonpi/emoncms/backup)**

Expand Down Expand Up @@ -76,20 +78,21 @@ In order to enable uploads of backup zip files we need to set the maximum upload

If running php5

If using php5

sudo nano /etc/php5/apache2/php.ini

If rnnning php5 (Stretch onwards)
If runnning php7 (Stretch onwards)


sudo nano /etc/php/7.0/apache2/php.ini


Use `[CTRL + W]` to search test

Set:

memory_limit = 1056M
post_max_size = 1G
upload_max_filesize = 1G
post_max_size = 3G
upload_max_filesize = 3G

# Create uploads folder

Expand Down

0 comments on commit 7730082

Please sign in to comment.