• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Copy Backup Files From Server to DropBox Cloud (HP Cloud)

By Abhishek Ghosh August 27, 2015 8:11 am Updated on August 27, 2015

Copy Backup Files From Server to DropBox Cloud (HP Cloud)

Advertisement

This Guide To Copy Backup Files From Server to DropBox Cloud, is Tested on HP Cloud & Will Work on All Servers including OpenStack Instances. There can be hundreds of problems with web content – web host issues, hacker attacks, migration, any disaster. For within the same datacenter, in case of OpenStack, OpenStack Raksha and Floating IP is the method of choice.

 

Copy Backup Files From Server to DropBox Cloud (HP Cloud)

 

This is file level backup. You can indeed upload the snapshot image to DropBox. We do not recommend to keep the method simple, easy to detect any security issue. If you need temporary or permanent migration, at least the website’s MySQL or any Database Backup and backup of the other files are very basic need to restore the website.

You must test the backups. Darren Rowse (problogger.net) has excellent articles for tips on Backup. Web Hosts are dangerous, particularly for the Non-US residents using US servers, always use multiple ways of backing up the website. If you do not have the backup, you will only get the texts from Google Cache and Way Back Machine. Always keep the meta index for this lifeboat.

Advertisement

---

We can not buy the servers, we are tenants on rent. DropBox Cloud Storage has a basic advantage – it has a free usage tier. You always need a free usage tier if you are living outside of US. If your payment method fails, that free cloud storage which you never cared will appear as Angel.

We are showing 100% manual method to copy backup files from server to DropBox Cloud Storage. Manual method is best as you can see what you are doing. First plan carefully what are mandatory files to restore the site, move them to a new directory, suppose named ~/backup, inside that directory, copy the essential files using cp command. An example structure :

Vim
1
2
3
4
5
6
-backup
|+--mysql
|+--wp-content
|+--nginx-settings
|+--ssl-certs
|+--extras

If you have WordPress, use WordPress database backup plugin, then the SQL backup will remain in wp-content directory. Then zip it and upload to dropbox if you dislike flat files to go to somewhere. You can add password if you zip in this way from SSH :

Vim
1
zip --encrypt yourfile.zip your files

To restive the files, rather to restore, you can use the “Share Link” of DropBox to retrieve the direct link to the file using wget. Do not forget the password! Try to make separate small directories & keep the size of the zips smaller. Do not use too much complicated password, if keyboard mapping disturbs, you’ll get in to solid trouble to restore.

The script supports a download option as command, apart from wget.

Copy Backup Files From Server to DropBox Cloud (HP Cloud)

 

Copy Backup Files From Server to DropBox Cloud Storage : Steps

 

Definitely you have DropBox Cloud Storage Account with sufficient storage. We have 18.25 GB by referrals earnings from our website guides’ links to register for DropBox. It is enough to have a bigger website’s backup fully free of cost. Let us start.

There is an excellent bash script named Dropbox Uploader, wget it and chmod it :

Vim
1
2
wget https://raw.github.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh
chmod +x dropbox_uploader.sh

Here is the actual Git of that script :

Vim
1
https://github.com/andreafabrizi/Dropbox-Uploader/

If you need automated work, then you’ll read it, else our guide is sufficient. Run the script now :

Vim
1
./dropbox_uploader.sh

at this point, you need to create an API based Dropbox App. If you search on Google Web Search with “Create Dropbox API App”, you will get some link like this :

Vim
1
https://www.dropbox.com/developers/apps/create

Open that webpage on Browser, select Dropbox API app as option and proceed. In very short, the App need to be fully permissive. Options changes when Dropbox upgrades their API, at the time of publication of this guide, you need to select – “No ” My app needs access to files already on Dropbox.” and “All file types ” My app needs access to a user’s full Dropbox.” options and create the App. You are the only user, there will be one App key and one App secret, you need only these two things for completion of the steps on SSH.

It is simple and easy. Take time and create it. After you supply on SSH, you will get exactly these things copied from SSH :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Permission type:
App folder [a]: If you choose that the app only needs access to files it creates
Full Dropbox [f]: If you choose that the app needs access to files already on Dropbox
 
# Permission type [a/f]: f
 
> App key is ABCD, App secret is XYZ and Access level is Full Dropbox. Looks ok? [y/n]: y
 
> Token request... OK
 
Please open the following URL in your browser, and allow Dropbox Uploader
to access your DropBox folder:
 
--> https://www.dropbox.com/1/oauth/authorize?oauth_token=
 
Press enter when done...

Visit that https://www.dropbox.com/1/oauth/authorize?oauth_token= URL on browser. Your setup will be complete. To list the directories present on Dropbox, execute :

Vim
1
./dropbox_uploader.sh list

Uploading is easy :

Vim
1
./dropbox_uploader.sh upload <file-name-on-ssh> <top-dir-name-on-dropbox>

For our example structure on the server, if you have created a directory on Dropbox named Backup, command can be :

Vim
1
./dropbox_uploader.sh upload /path/to/yourfile.zip Backup

Test with small files. Now, it is basically risky to run the command to upload bigger files. If you get disconnected from SSH, things may go wrong! So, we need to create a cron. Evoke cron by running :

Vim
1
crontab -e

This is how the structure of cron goes :

Vim
1
2
3
4
5
6
7
# +---------------- minute (0 - 59)
# |  +------------- hour (0 - 23)
# |  |  +---------- day of month (1 - 31)
# |  |  |  +------- month (1 - 12)
# |  |  |  |  +---- day of week (0 - 6) (Sunday=0 or 7)
# |  |  |  |  |
  *  *  *  *  *  command to be executed

So, if we add :

Vim
1
0 2 * * * /path/to/dropbox_uploader.sh delete Backup/back-up-file.zip; /path/to/dropbox_uploader.sh upload /path/to/back-up-file.zip Backup

0 2 * * * -> every day at 2 am
/path/to/dropbox_uploader.sh delete Backup/back-up-file.zip -> normal command to delete the old upload
/path/to/dropbox_uploader.sh upload /path/to/back-up-file.zip Backup -> normal command to upload the updated stuff

It can be dangerous – if you delete the server dir, Dropbox have nothing! Cron will not work in that case of emergency, you need to use a script like this to keep it executing the even after you have logout from your session (take it as upload.sh) :

upload.sh
Vim
1
2
3
4
5
6
#!/bin/bash
while true
do
/path/to/another/script.sh
sleep 5
done

chmod it to become executable by running chmod +x upload.sh command.
/path/to/another/script.sh is the command-full script (take it as script.sh) like this :

script.sh
Vim
1
2
#!/bin/bash
sudo -u root ./dropbox_uploader.sh upload <file-name-on-ssh> <top-dir-name-on-dropbox>

First test the script by executing it manually :

Vim
1
2
chmod +x script.sh
./script.sh

If you run :

Vim
1
nohup ./script.sh &

the command will continue doing even if you log out from SSH. If you run :

Vim
1
nohup ./upload.sh &

then the script will run every 5 minutes even if you log out from SSH. We have created a Github repo here for you, so that, you do not need to copy-paste.

Tagged With https://www dropbox com/?_hp= , copying files from server to a cloud server
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Copy Backup Files From Server to DropBox Cloud (HP Cloud)

  • Command Prompt Commands : Alphabetical list of all commands in Windows 7

    Command Prompt Commands in Windows 7 provides the user access to 180+ command line commands. Here is a list of 200 Command Prompt Commands in Windows 7.

  • Ways To Backup MySQL Database And Save To Cloud Storage

    Here Are Ways To Backup MySQL Database And Save To Cloud Storage Including OpenStack Swift From SSH Side. Needed Scripts Has Been Included.

  • Incremental Backup Versus Differential Backup on Cloud Storage

    On Cloud Storage Like OpenStack Swift, We Can Set Different Backup Strategy on Our Need. Here is Brief Theoretical Background Behind Incremental Backup Versus Differential Backup.

  • Cloud Computing Articles – List With Description of all we have Published

    Cloud Computing Solution penetrating as business solution and in day to day usage. Here is list of all articles on Cloud computing we have published so far.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy