backing_up_your_data
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
backing_up_your_data [2021/08/19 15:26] – atolstov | backing_up_your_data [2021/11/17 09:54] – [Crontab on Linux] atolstov | ||
---|---|---|---|
Line 22: | Line 22: | ||
- | <code bash> | + | <code bash backup.sh> |
#!/bin/bash | #!/bin/bash | ||
# Create a folder ~/ | # Create a folder ~/ | ||
LOG_DIR=" | LOG_DIR=" | ||
- | cd $LOG_DIR | ||
# download the yesterday' | # download the yesterday' | ||
yesterday=$(date +" | yesterday=$(date +" | ||
+ | cd $LOG_DIR | ||
# because login and pass for the ftp connection are unencrypted you can | # because login and pass for the ftp connection are unencrypted you can | ||
# restrict read/write access mode to the file with chmod command) | # restrict read/write access mode to the file with chmod command) | ||
wget --user=admin --password=' | wget --user=admin --password=' | ||
+ | #archive to save storage space | ||
+ | gzip -v log-$yesterday.sqlite3 | ||
</ | </ | ||
- | |||
- | Add the script to the //crontab// with the parameters: | ||
- | 10 0 * * * / | ||
- | to run it every day at 00:10 | ||
<WRAP center round tip 60%> | <WRAP center round tip 60%> | ||
Do not forget grant additional run permissions | Do not forget grant additional run permissions | ||
</ | </ | ||
- | chmod a+x / | + | chmod u+x / |
+ | |||
+ | |||
+ | Add the script to the //crontab// with the parameters: | ||
+ | 10 0 * * * / | ||
+ | to run it every day at 00:10 | ||
New files will only be added to ~/ | New files will only be added to ~/ |
backing_up_your_data.txt · Last modified: 2023/05/02 10:43 by atolstov