• This project
    • Loading...
  • Sign in

Junyoung Jung / Unix_System_Programming_autobackup

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • Unix_System_Programming_autobackup
  • backup.sh
  • Junyoung Jung's avatar
    Update backup.sh · e72ba5e5
    e72ba5e5 Browse Files
    Junyoung Jung authored 2016-10-27 17:31:56 +0900
backup.sh 343 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/bin/bash

NAME=$(date +%y%m%d)

HOST='User remote server ip'
USER='User id'
FILE=$NAME'.tar'

MakeTarFile() {
	tar -cvzf $NAME.tar *
}

ConnectSFTP() {
	sftp $USER@$HOST 2> /dev/null << END_SCRIPT
	put $FILE
	quit
END_SCRIPT
}

for i in {0..75..3}
	do
		MakeTarFile > /dev/null
		ConnectSFTP > /dev/null
		rm $FILE

		sleep 3m
	done

exit 0