Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 06-28-2007, 01:48 AM   #1
Registered: Jun 2007
Posts: 64

Rep: Reputation: 15
how to rsync at shutdown


I joined this forum only today and was very delighted about that. I am working as a linux admin as a fresher and i have a problem which i couldn't solve. I configured a system such that it will rsync its home directory to another system. I want to run the script at shut down or reboot but it doesn't seem to be working since ssh is being stopped before my script is run. Can anybody give a sol. to my problem? Thanks in advance.
Old 06-28-2007, 07:33 AM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,396

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
If only one user eg root is doing shutdown, then you can add your script under the same name, but nearer the start of the $PATH for that user, then it can do it's stuff, then call real shutdown.
Another option (may be confusing to any other potential admin on your box) is to rename the real shutdown to something else and replace it with your script, which then calls real one after rsync is done.
Old 06-28-2007, 08:03 AM   #3
LQ Newbie
Registered: Jun 2007
Posts: 23

Rep: Reputation: 15
chrism01 has it right, that's precisely what i would do.
Old 06-28-2007, 08:14 AM   #4
Senior Member
Registered: Oct 2004
Posts: 1,192

Rep: Reputation: 101Reputation: 101
No, I wouldn't do anything like that.

I would find the appropriate place in the shutdown scripts. For example, in Arch /etc/rc.local.shutdown is one of the first things to be executed in the shutdown procedure and before any daemon is killed. This file is also designed for such things, so this is where I'd put a call to your rsync script.

Of course you didn't state your distribution and more than likely things will be slightly different, so your on your own with that.


rsync+ssh, shutdown

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
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM
Linux full shutdown vs. manual shutdown? LQtoto Linux - General 9 01-26-2005 06:21 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
Cannot shutdown computer or kill -9 hung rsync JLindenmuth Linux - General 0 05-05-2004 01:23 PM
konsole shutdown possible? or key combo = shutdown possible? Laptop2250 Linux - Newbie 3 11-16-2003 10:44 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:32 AM.

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