LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-28-2024, 10:39 AM   #1
i1mw3b
LQ Newbie
 
Registered: Mar 2024
Location: south florida
Distribution: mint
Posts: 2

Rep: Reputation: 0
rsync running within bash scripts exits the script after fininishing


I have a bash script doing incremental (link-dest) rsync backups for my home directory.
One file is owned by root and rsync gives this message, then continues:

rsync: [sender] send_files failed to open "/home/jww/src/kkll": Permission denied (13)

Then when the rsync command is complete, it spits out this message. Then continues with it's summary
message, e.g. total size is ....

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]

Then the script exits. Now, I understand the errors. The file kkll is owned by root and user has no read permission, which I fixed.

I am very curious tho, why rsync would continue to finish and just exit, instead returning a return code.

Love rsync however. Written by some very smart folks.

Thanks,

Jimmy
 
Old 04-02-2024, 01:32 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
I hope you realize that without sharing the script so we can read your logic and see how you trapped (or did not trap) the return code (I hope you read the rsync man page to identify the return codes it issues) it is difficult for us to evaluate your question, much less answer it.
 
Old 04-05-2024, 09:18 AM   #3
i1mw3b
LQ Newbie
 
Registered: Mar 2024
Location: south florida
Distribution: mint
Posts: 2

Original Poster
Rep: Reputation: 0
Solved. My stupidity.
Your comment to include my script caused me to create a very small script to illustrate and it worked. Then realized I had a "set -eo pipefail" in my script. Must've cut and pasted from somewhere.

Thanks,
 
Old 04-05-2024, 10:40 AM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Glad you found that!
Best of luck!
 
  


Reply



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
Shell script exits after running a chroot command kechlion Linux - Newbie 4 01-04-2010 09:28 AM
bash - setting a persistent variable that remains after the script exits CJ Chitwood Programming 9 01-24-2009 07:48 PM
i am running 2 scripts in background if 1 exits with error the other should also exit pradyumna_reddy Programming 2 11-24-2008 01:42 PM
running 2 scripts in background ,if any 1 exits with error the other 1 also exit pradyumna_reddy Linux - General 2 11-20-2008 01:54 PM

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

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