what files/directories do you recommend to backup

as some of you reported sd-card failures - today i thought maybe it could be good idea to set up a cronjob on my 2 feeding raspis that targzs some essential files each night and automatically sends them via sftp to my data server overnight. a backup of the whole system is not needed as i have already images of the feeder sd-cards.

what files/directories would you recommend (e.g. *.rrd files) are worth to be backed?

tom

This is how I back up my Pi. ads-b-flight-tracking-f21/backing-up-the-pi-t36188.html?

After installing a new SD card I can just restore these files and the Pi is ready to go to work.

aaah - perfect - helps much :slight_smile: did not find this via search function over the last days. there i can see what directories you backup. are there some kinds of logfiles from pi included?

I haven’t been backing up the log files, but you could easily adapt the simple backup script to copy logs to your USB stick, too.

thanks much jepolch :slight_smile:

btw. you can easily auto-transfer your data to another machine instead:

generate ssh key → copy file .ssh/id_rsa.pub and save it renamed to authorized_keys2 on remote server directory .ssh


ssh-keygen -t rsa

then execute a little script like this via cron on the machine you want to save the backup to:


sftp your_user_id@your_raspi_ip << EOF
lcd backup
cd backup
get your_raspi_name_`date +%Y_%m_%d`.tar.gz
bye
EOF
exit 0

what other logs would you backup?

  • /var/lib/collectd
  • /var/log/dump1090-mutability.log (and all with .1 .2 …) btw obj how about the idea to make a directory ‘dump1090-mutability’ within log?

where and what other log files from piaware and dump1090-mutability?

If you want to do that, it’s configurable.

aah - thanks - i remember some screen in your reconfigure utility …
beside these dump-logs there are only the one/two days logs from piaware - or have i missed some?

scp will let you do this in one line.


scp filename.tar.gz user@ipaddress:/location/to/copy/file/filename.tar.gz

Your way of generating the ssh keys is definitely the best method but I use a handy program called sshpass that allows you to put the ssh password into the command (but that obviously isn’t recommended for security reasons).


sshpass -p password scp filename.tar.gz user@ipaddress:/location/to/copy/file/filename.tar.gz

You can also use a file with the password that is secured to prevent using your password directly in the script


sshpass -f filewithpassword scp filename.tar.gz user@ipaddress:/location/to/copy/file/filename.tar.gz

The only thing you need to do manually before all this is ssh into the system once so it’s added to the knownhosts file, otherwise sshpass won’t work. Once that’s done it’ll happily feed the passwords to scp/ssh etc.