Skip to content

Instantly share code, notes, and snippets.

@waqarNaeem786
Created May 12, 2024 09:31
Show Gist options
  • Save waqarNaeem786/9622896fee355b345b77b9a48bacd4a9 to your computer and use it in GitHub Desktop.
Save waqarNaeem786/9622896fee355b345b77b9a48bacd4a9 to your computer and use it in GitHub Desktop.
#!/bin/bash
cd /var/www
crontab -l > cronStetup
ip=$(ip -4 addr show eth0 | awk '/inet / {print $2}' | cut -d'/' -f1)
dt=$(date +"%Y-%m-%d_%H-%M-%S" | tr -d ':')
zip -D "${ip}_${dt}.zip" *
# rclone copy *.zip gdrive:${ip}_backup
find . -maxdepth 1 -type f -name "${ip}_${dt}.zip" -exec rclone copy {} gdrive:${ip}_backup \;
rm -r *.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment