Hi everyone,
I made a script to create new snapshot and export it to USB drive.
I have problem with export to the USB drive. The export creates both *.tar.gz and *.info files when executing the command using SSH connection.
Unfortunately, it looks like the *.info file is not created when calling Schnapps from the script. The script is called by the cron.
Any idea what can be wrong?
Here are additional details:
MOX running TOS 5.2.7
USB Drive: SanDisk Corp. Cruzer Fit, FAT32 formatted
Script is triggered by the cron, stored in /etc/ and rights set to 0755.
The script itself looks like this:
# Create new snapshot
schnapps create -t time "bckp-to-USB"
# Get number of the latest schnapshot created using Schnapps
LatestSnapshot=$(schnapps list -j | python -c "import sys, json; print(json.load(sys.stdin)['snapshots'][-1]['number'])")
# Create a directory to be the mount point for the USB drive.
mkdir /mnt/usb
# Mount the /dev/sda1 device (the first partition of the USB drive) to the mount point.
mount /dev/sda1 /mnt/usb
# Create directory “old_snapshots” in case it is missing
mkdir -p /mnt/usb/old_snapshots
# Move existing snapshots (if any) to old_snapshots (with overwriting)
mv -f /mnt/usb/*-medkit-* /mnt/usb/old_snapshots
# Export the latest snapshot to the USB drive
schnapps export $LatestSnapshot /mnt/usb
# Unmount the /mnt/usb mount point
umount /mnt/usb
# Remove the directory used for the mount point
rmdir /mnt/usb