Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Junyoung Jung
/
Unix_System_Programming_autobackup
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
Authored by
Junyoung Jung
2016-10-27 16:23:44 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
af10de17fbafaa6593fc5bb75a3907301040415f
af10de17
1 parent
db052651
Update backup.sh
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
backup.sh
backup.sh
View file @
af10de1
#!/bin/bash
NAME
=
$(
date +%
m%d%H%M
)
NAME
=
$(
date +%
y%m%d
)
HOST
=
'
User remote server ip
'
USER
=
'
User id
'
HOST
=
'
celinux2.khu.ac.kr
'
USER
=
'
usp33
'
FILE
=
$NAME
'.tar'
tar -cvzf
$NAME
.tar
*
MakeTarFile
()
{
tar -cvzf
$NAME
.tar
*
}
sftp
$USER
@
$HOST
<< END_SCRIPT
put $FILE
quit
ConnectSFTP
()
{
sftp
$USER
@
$HOST
<< END_SCRIPT
put $FILE
quit
END_SCRIPT
}
for
i
in
{
0..75..3
}
do
MakeTarFile
ConnectSFTP
rm
$FILE
sleep 3m
done
exit
0
\ No newline at end of file
...
...
Please
register
or
login
to post a comment