Advertisement
Guest User

VovaTiunov

a guest
Nov 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/bash
  2. #mkdir backuup
  3. pathToDirectory="/home/admin00/Desktop/aaa/"
  4. #firstsize=$(du -bS *.txt $pathToDirectory)
  5. rasshirenie=".txt"
  6. currentDate=$(date +%Y-%m-%d)
  7. tar -cf backuup/ArchiveForBackup$currentDate.tar $pathToDirectory*$rasshirenie
  8. tar -xf backuup/ArchiveForBackup$currentDate.tar >> /dev/null; echo $?
  9.  
  10. #cat <(crontab -l) <(echo "0 0 * * 0/home/admin00/Desktop/backup.sh") | crontab -
  11. #(crontab -l 2>&/dev/null; echo "0 0 * * 5/home/admin00/Desktop/backup.sh")|crontab -
  12. #crontab -l|{cat; echo "0 0 * * 0/home/admin00/Desktop/backup.sh";}|crontab -
  13. #does backup every friday
  14. # in terminal: crontab -e, then ****0/home/admin00/Desktop/backup.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement