You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
Save the following text in a script somewhere on your system (preferably as a .sh file):
#!/bin/sh# Create folder with the date`
mkdir /tmp/$( date '+%Y-%m-%d')# Copy your file into the folder
cp /var/<Your file> /tmp/$( date '+%Y-%m-%d')/<Your file># Goes to the tmp directorycd /tmp/
# Creates a tar.gz file in the folder
tar -zcf $( date '+%Y-%m-%d').tar.gz $( date '+%Y-%m-%d')# Uses gdrive to upload file to Google Drive (change path to gdrive if necessary)
/usr/local/bin/gdrive upload $( date '+%Y-%m-%d').tar.gz
# Remove folder
rm -rf /tmp/$( date '+%Y-%m-%d')# Remove file
rm -rf /tmp/$( date '+%Y-%m-%d').tar.gz
To run in cron, add /bin/bash <your .sh file> to your crontab (varies by distro)