Skip to content

Dropbox upload not working #566

@ChirpyTurnip

Description

@ChirpyTurnip

Hi,

I'm trying to get the DropBox upload working for my IOTStack backups. The good news is that DropBox part is working fine though it was really hard to set up - I use puTTY and the keyboard inputs (e.g. for the dropbox credentials) don't echo in the console so I'm working blind - that was a major pain! Anyway, I got it to work in the end and if I run:

./dropbox_uploader.sh upload ~/IOTstack/backups/backup/* /

Then I get this:

 > Uploading "/home/pi/IOTstack/backups/backup/backup_2022-01-30_1518.tar.gz" to "/backup_2022-01-30_1518.tar.gz"... DONE
 > Uploading "/home/pi/IOTstack/backups/backup/backup_2022-04-29_1143.tar.gz" to "/backup_2022-04-29_1143.tar.gz"... DONE
 > Uploading "/home/pi/IOTstack/backups/backup/backup_2022-05-29_0724.tar.gz" to "/backup_2022-05-29_0724.tar.gz"... DONE
 > Uploading "/home/pi/IOTstack/backups/backup/backup_2022-05-29_0952.tar.gz" to "/backup_2022-05-29_0952.tar.gz"... DONE
 > Uploading "/home/pi/IOTstack/backups/backup/backup_2022-05-29_0955.tar.gz" to "/backup_2022-05-29_0955.tar.gz"... DONE
 > Uploading "/home/pi/IOTstack/backups/backup/backup_2022-05-29_1003.tar.gz" to "/backup_2022-05-29_1003.tar.gz"... DONE

And the files show up fine in DropBox. So this part is solid.

However, when I run the backup from the IOTStack menu it creates the backup but it doesn't execute the upload. The output I get is this:


### IOTstack backup generator log ###
Started At: 2022-05-29T10-29-17
Current Directory: /home/pi/IOTstack
Backup Type: 3
Backup File: ./backups/backup/backup_2022-05-29_1029.tar.gz
Rolling File: ./backups/rolling/backup_7.tar.gz

Executing prebackup scripts
Some networks were defined but are not used by any service: nextcloud
Service "zigbee2mqtt" uses an undefined network "iotstack_nw"
Rolling Overwritten: True
Backup Size (bytes): 10709300

Executing postbackup scripts
Some networks were defined but are not used by any service: nextcloud
Service "zigbee2mqtt" uses an undefined network "iotstack_nw"

Finished At: 2022-05-29T10-29-26

Items backed up:

./services/
./volumes/
./docker-compose.yml

Items Excluded:
 - No items

### End of log ###


Backup completed.
Press [Up] or [Down] arrow key to show the menu if it has scrolled too far.

There is no upload or even any attempt top upload the files to Dropbox. I dug around and found that there was a need for a 'dropbox' file in the ~/IOTStack/backups folder so I created that. It made no difference. I poked around a bit and found the post_backup_complete.sh file that calls a post_backup.sh file (if one exists) - so I created a post_backup.sh file in the same location and added the command (from above) that runs the upload to Dropbox.

When I test this by just running the post_backup_complete.sh it runs fine and uploads my files as expected. You'd think at that point you've cracked it, but no as this is not executed when I use the backup command from the IOTStack menu.

So now I try to simply run the backup.sh script from the scripts dir and I get this:

### IOTstack backup generator log ###
Started At: 2022-05-29T10-10-59
Current Directory: /home/pi/IOTstack/scripts
Backup Type: 3
Backup File: ./backups/backup/backup_2022-05-29_1010.tar.gz
Rolling File: ./backups/rolling/backup_7.tar.gz

Executing prebackup scripts
bash: ./scripts/backup_restore/pre_backup_complete.sh: No such file or directory
tar: ./services: Cannot stat: No such file or directory
tar: ./volumes: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
Rolling Overwritten: False
Backup Size (bytes): 45

Executing postbackup scripts
bash: ./scripts/backup_restore/post_backup_complete.sh: No such file or directory

Finished At: 2022-05-29T10-11-00

Items backed up:

./services/
./volumes/

Items Excluded:
 - No items

### End of log ###

The backup runs but it specifically says that there is 'no such file or directory' when it goes looking for the pre/post backup scripts.

I just can't get this to run and I feel like I'm missing something really obvious. Most of the IOTStack stuff is great as it just runs right out of the box.....but this one has me stumped. I suck at Linux so simple pointers would be appreciated. I have three IOTStack instances so getting the backups running would be good as I don't know how long I have before the SD cards will be fried. ;-)

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions