How to backup your website through SSH command line?

Dr. McKay

Well-known member
Joined
Nov 26, 2016
Messages
343
Best answers
0
Ratings
22
Points
18
#1
Normally I have to use both SSH and Phpmyadmin to backup files, folders, mysql databases. I am wondering if there is a way only use SSH command line to backup whole my website files and databases?
 

DenisMNE

Corporate Member
Corporate Member
Joined
Apr 11, 2018
Messages
108
Best answers
0
Ratings
9 2
Points
18
#2
I did some research and I might be able to provide you an answer for it.
It might be pretty simple, so please check it out and let me know did it work.
Hope it helps :

download.png
 

Chris Worner

Well-known member
Joined
Apr 15, 2016
Messages
331
Best answers
0
Ratings
31
Points
28
#3
Chris Worner
These commands are just to compress your current files and folders in public_html folder, It didn't include databases of your websites in it. If you just are doing that, your backup is not completed.
 

VirtuBox

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,517
Best answers
4
Ratings
392 12
Points
83
#5
Normally I have to use both SSH and Phpmyadmin to backup files, folders, mysql databases. I am wondering if there is a way only use SSH command line to backup whole my website files and databases?
To backup a database, you just need to run

Bash:
mysqldump -u database_user -p database_name > database_dump.sql
Then you can make an archive with all your files with tar :
Bash:
# To extract an uncompressed archive:
tar -xvf /path/to/foo.tar

# To create an uncompressed archive:
tar -cvf /path/to/foo.tar /path/to/foo/

# To create a .gz archive:
tar -czvf /path/to/foo.tgz /path/to/foo/

# To create a .bz2 archive:
tar -cjvf /path/to/foo.tgz /path/to/foo/
 
Older Threads
Replies
0
Views
108
Replies
23
Views
720
Replies
1
Views
154
Newer Threads
Replies
3
Views
134
Replies
6
Views
232
Replies
0
Views
58
Replies
0
Views
114
Latest Threads
Replies
0
Views
2
Replies
0
Views
9
Replies
0
Views
9
Replies
2
Views
38
Replies
4
Views
22
Recommended Threads
Replies
9
Views
1,306
fwh
Replies
28
Views
5,203
Replies
12
Views
2,917

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top