LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-03-2017, 09:23 AM   #1
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 14.1, 14.2; Debian Jessie; Centos 6; FreeBSD 9 & 10
Posts: 280

Rep: Reputation: 35
rsync backups


cron runs a nightly job on my main computer to backup some directories to a NAS. I hoped to put a list of the files backup up into one file and errors into a second, but those two files have no entries other than the start and end dates. This is my syntax:

date > /home/xxx/backups
date > /home/xxx/nightly_files
date > /home/xxx/nightly_probs
rsync -avzrcpt /home/xxx/Downloads /media/nas2/xxx 1>>nightly_files 2>>nightly_probs
date >> /home/xxx/backups
date >> /home/xxx/nightly_files
date >> /home/xxx/nightly_probs

What have I done wrong
 
Old 12-03-2017, 10:07 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,614

Rep: Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576
Quote:
Originally Posted by apolinsky View Post
cron runs a nightly job on my main computer to backup some directories to a NAS. I hoped to put a list of the files backup up into one file and errors into a second, but those two files have no entries other than the start and end dates. This is my syntax:

date > /home/xxx/backups
date > /home/xxx/nightly_files
date > /home/xxx/nightly_probs
rsync -avzrcpt /home/xxx/Downloads /media/nas2/xxx 1>>nightly_files 2>>nightly_probs
date >> /home/xxx/backups
date >> /home/xxx/nightly_files
date >> /home/xxx/nightly_probs

What have I done wrong
Since you didn't specify a full path for those files in the rsync command, they will be written in whatever directory you were in when you ran that command, not necessarily /home/xxx/ .
 
1 members found this post helpful.
Old 12-03-2017, 11:02 AM   #3
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 14.1, 14.2; Debian Jessie; Centos 6; FreeBSD 9 & 10
Posts: 280

Original Poster
Rep: Reputation: 35
Thank you very much; don't know how I missed that one.
 
Old 12-04-2017, 01:49 AM   #4
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,270

Rep: Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584Reputation: 584
Whenever I need a rsync script, I download the Debian mirroring package, ftpsync: https://ftp-master.debian.org/ftpsync.tar.gz and modify the scripts to what I want. But bacula is a better back-up program than raw rsync. Also, I think some of your switches are redundant or unnecessary. The -a switch includes rlptgoD.
 
Old 12-04-2017, 06:36 AM   #5
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 14.1, 14.2; Debian Jessie; Centos 6; FreeBSD 9 & 10
Posts: 280

Original Poster
Rep: Reputation: 35
That's very helpful. I('ve used rsync for years but have learned several new additional methods.
 
Old 12-05-2017, 10:48 AM   #6
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,591
Blog Entries: 15

Rep: Reputation: Disabled
Quote:
Originally Posted by apolinsky View Post
That's very helpful. I('ve used rsync for years but have learned several new additional methods.
Please have a look at the old and tired documentation?

Code:
man rsync
as it states
Code:
            --log-file=FILE         log what we're doing to the specified FILE
            --log-file-format=FMT   log updates using the specified FMT
With Linux as usual, there is more than 1 way to "get 'er done".
 
1 members found this post helpful.
  


Reply

Tags
rsync


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
[SOLVED] rsync backups? dchmelik Slackware 4 03-28-2015 09:22 PM
[SOLVED] rsync Backups d072330 Linux - Software 11 01-30-2013 07:09 PM
rsync - Backups pkraus109 Linux - Server 2 05-21-2009 01:36 PM
Rsync backups gabsik Linux - General 3 11-24-2006 08:14 PM
Rsync backups gabsik Linux - Networking 1 03-30-2006 11:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:00 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