LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 08:23 AM   #1
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 15;
Posts: 442

Rep: Reputation: 47
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, 09:07 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
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, 10:02 AM   #3
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 15;
Posts: 442

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

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
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, 05:36 AM   #5
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 15;
Posts: 442

Original Poster
Rep: Reputation: 47
That's very helpful. I('ve used rsync for years but have learned several new additional methods.
 
Old 12-05-2017, 09:48 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

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



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

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

All times are GMT -5. The time now is 11:45 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
Open Source Consulting | Domain Registration