LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-16-2013, 02:20 PM   #1
Nathanraymond
LQ Newbie
 
Registered: May 2013
Location: Portland, OR
Posts: 5

Rep: Reputation: Disabled
Unhappy Need help with Command


I am new to linux. I am trying to run backup using cron command it is not working what is command to backup? Any help would be appreciated. Thanks
 
Old 05-16-2013, 02:26 PM   #2
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,001

Rep: Reputation: 67
as far as i know, there is no "backup" command on linux. You'd have to be more specific about what your goals are. You could use the cp command to copy a directory structure from one disk to another. You could use the rsync command to just copy the files that have changed. You could use the dd command to copy an entire disk.
 
1 members found this post helpful.
Old 05-16-2013, 02:32 PM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
cron is a command to run jobs periodically.

You need to have a script or an application to run which will perform the backups and then you can schedule it with cron.

Search the web for recommendations of apps which you can use. Sorry, I'm not a sysadmin and my backups have solely been limited to mirroring data onto a server or external drive.
 
1 members found this post helpful.
Old 05-16-2013, 02:33 PM   #4
Nathanraymond
LQ Newbie
 
Registered: May 2013
Location: Portland, OR
Posts: 5

Original Poster
Rep: Reputation: Disabled
I have looking on the internet and seen that "cron" command was for using backups. Am I wrong? I am just trying to backup my user directory. I just need to know what command would be best for copying directories? Thanks
 
Old 05-16-2013, 02:40 PM   #5
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,001

Rep: Reputation: 67
Quote:
Originally Posted by Nathanraymond View Post
I have looking on the internet and seen that "cron" command was for using backups. Am I wrong? I am just trying to backup my user directory. I just need to know what command would be best for copying directories? Thanks
cron is not a "command" really -- at least not in the sense that you would ever type it into a terminal window. It is a process that is launched at startup and runs continuously on a linux machine in order to execute scheduled operations. Of course, you could have found that out by googling 'cron'. The very first result on google is the wikipedia article which is pretty informative.

While the cron process runs all the time, executing scheduled scripts, it will not back anything up or copy any files unless one of the scheduled scripts that it executes is written to do so.

If you want to copy your user directory to someplace, I would recommend looking around for a script that has already been written and then you can install it as a scheduled operation by editing your user's crontab:
Code:
crontab -e
The format of a crontab entry is described in the wikipedia article.
 
1 members found this post helpful.
Old 05-16-2013, 02:42 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
I would create a script to copy you user directory to an external or thumb drive on a daily basis and schedule that script using cron.

The script could be as simple as:

Code:
#!/bin/sh
cd /home/myuser
cp * /media/backup/.
You could use a common mount point where the backup drive is so the name is consistent, you could use the current date and time to create a directory to sub into where you'd copy the backup. You could also tar and zip your data so that it would be smaller.
 
1 members found this post helpful.
Old 05-16-2013, 03:01 PM   #7
Nathanraymond
LQ Newbie
 
Registered: May 2013
Location: Portland, OR
Posts: 5

Original Poster
Rep: Reputation: Disabled
thanks everyone I think I have a general idea thanks for all the suggestions
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command/Script required to send an email alert in case command will not respond rajaniyer123 Linux - General 1 05-19-2012 02:12 PM
Executing shell command from JSP file with command line arg from URL orcusomega Programming 2 01-13-2012 04:38 PM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 12:21 PM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 03:14 AM
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 07:30 PM


All times are GMT -5. The time now is 02:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration