Back up script

A category for tips and tricks or off-topic things
Post Reply
mexjerry
Posts: 21
Joined: Mon Apr 11, 2016 6:54 pm

Back up script

Post by mexjerry » Wed Apr 12, 2017 1:41 pm

A power problem resulted in a non-bootable Pi. I have since installed Archpi once again, from scratch.
I am able to view the file /srv/http/ on the corrupt disk using debugfs, however, it is not mountable, and therefore I am not able to copy anything. At this time I am making a copy of the disk, using DD, and hope to salvage the information.
There was mention of a back-up script in previous posts, would that be available somewhere?
thanks
jerry

jeanmarc
Posts: 1866
Joined: Thu Aug 29, 2013 7:16 am

Re: Back up script

Post by jeanmarc » Wed Apr 12, 2017 4:33 pm

did you try to fsck -a /dev/yourdrive ?

mexjerry
Posts: 21
Joined: Mon Apr 11, 2016 6:54 pm

Re: Back up script

Post by mexjerry » Wed Apr 12, 2017 8:19 pm

Thanks jeanmarc
The dd copy is still progressing, when it completes I will attempt what you have suggested.

mexjerry
Posts: 21
Joined: Mon Apr 11, 2016 6:54 pm

Re: Back up script

Post by mexjerry » Sat Apr 15, 2017 12:47 pm

I have not forgot this thread, ddrescue is still running 173807 seconds and counting!
Thats 48.25 hours.
thanks
jerry

mexjerry
Posts: 21
Joined: Mon Apr 11, 2016 6:54 pm

Re: Back up script

Post by mexjerry » Sun Apr 16, 2017 5:05 pm

After over 68 hours, I have a copy of the bad disk, and secured a copy of the data.
The data from the bad disk was copied to /srv/http/123solar/data/invt1/csv on the new install disk.
An ls -all of the above:

-rw-r--r-- 1 http http 20791 Apr 16 10:52 20160715.csv

which is the same permissions of the current files.
Selecting the Production tab in 123solar, I expected to see the production split into the current year, and the previous year, I only see the current year production total.
I copied a total of 97 files from last year, into the /srv/http/123solar/data/invt1/csv file.
What am I missing.
thanks
jerry

jeanmarc
Posts: 1866
Joined: Thu Aug 29, 2013 7:16 am

Re: Back up script

Post by jeanmarc » Sun Apr 16, 2017 7:45 pm

You're that patient ;)
/data/invt1/csv/ is for detailled files. You need to import /data/invt1/production/energy*.csv.

It is wise to make a backup of the data folder.. I do that daily with a ftp script.

mexjerry
Posts: 21
Joined: Mon Apr 11, 2016 6:54 pm

Re: Back up script

Post by mexjerry » Sun Apr 16, 2017 9:55 pm

Thanks
Care to share the script?
Thanks for the pointer on where the files need to go
jerry

jeanmarc
Posts: 1866
Joined: Thu Aug 29, 2013 7:16 am

Re: Back up script

Post by jeanmarc » Mon Apr 17, 2017 6:54 am

Sure, it is here. I daily backup the whole www directory to my nas.
Edit the scripts then
  • systemctl enable backup.timer
  • systemctl start backup.timer
  • systemctl status backup.timer
Did you restored your production data ?

mexjerry
Posts: 21
Joined: Mon Apr 11, 2016 6:54 pm

Re: Back up script

Post by mexjerry » Mon Apr 17, 2017 1:37 pm

Got it all
thanks for the help and script
jerry

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest