<div dir="ltr"><div><div>Hi <br><span tabindex="-1" id="result_box" class="" lang="en"><span class="">first of all</span> <span class="">I thank</span> <span class="">all those who have</span> <span class="">tried to help me</span><span>.</span> <br><span class="">Now</span> <span class="">I have</span> <span class="">lost hope</span> <span class="">that</span> <span class="">this</span> <span class="">problem is</span> <span class="">currently</span> <span class="">solved</span> <span class="">by me.</span> <br><span class="">So</span> <span class="">I made</span> <span class="">a link to a</span> <span class="">command</span> that <span class="">*</span> <span class="">MANUALLY</span> <span class="">*</span> starts the file <span class="">/etc/rc.d/rc.init</span><span>,; I can run this</span> <span class="">command</span> <span class="">via a</span> <span class="">graphical</span> <span class="">icon using</span> <span class="">Gnome interface</span><span>.<br><br></span></span><br><span tabindex="-1" id="result_box" class="" lang="en"><span class="">This</span> <span class="">can be</span> <span class="">sufficient</span> <span class="">for my needs</span><span>,</span> <span class="">at present</span> <span class="">...</span> <br><br><span class="">Perhaps,</span> <span class="">increasing my</span> <span class="">experience,</span> <span class="">I will be able</span> <span class="">to find</span> <span class="">a better solution</span> <span class="">in the future.</span> <br><br><span class="">Thanks mostly</span> <span class="">to Ed<br><br></span></span></div><span tabindex="-1" id="result_box" class="" lang="en"><span class="">Regards<br><br></span></span></div><span tabindex="-1" id="result_box" class="" lang="en"><span class="">Angelo<br></span></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 1, 2014 at 10:12 PM, Bill Davidsen <span dir="ltr"><<a href="mailto:davidsen@tmr.com" target="_blank">davidsen@tmr.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Angelo Moreschini wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I would say that this thread is the continuation of a my preceding thread :<br>
<br>
“selecting some kind of files using the resync command”<br>
<br>
<br>
There I got help in order to make the backup of some my critical files.<br>
<br>
Now I am able to backing up these files using a shell script from the line command.<br>
<br>
But I would like also that this backup runs automatically when the computer boots.<br>
<br>
<br>
I know that this task is performed by the rc.local file, in Linux.<br>
<br>
Ed Greshko gave me a link about an announcement of Fedora concerning rc.local ....<br>
<br>
there is wrote :<br>
<br>
- - - - - - - - - -<br>
<br>
The |/etc/rc.d/rc.local| local customization script is no longer included by<br>
default. Administrators who need this functionality merely have to create this<br>
file, make it executable, and it will run on boot.<br>
<br>
- - - - - - - - - -<br>
<br>
<br>
After I read this announcement, I create the the file rc.local and I made it<br>
executable:<br>
<br>
[angelo_dev@zorro rc.d]$ ls -l /etc/rc.d/rc.local<br>
<br>
-rwxr-xr-x. 1 root root 1262 Oct 27 12:18 /etc/rc.d/rc.local<br>
<br>
<br>
But, doing some tests, I saw that the scripts stored inside rc.local not run at<br>
boot, ...on my computer.<br>
<br>
<br>
I would like to have some advice concerning the way to manage tests, in order to<br>
understand because the content of rc.local is not executed at the start... and<br>
toobtain thatscripts run atthe boot<br>
<br>
</blockquote></div></div>
Having followed the thread as of the time of this message, a few comments about scripts and such.<br>
<br>
1 - redirection<br>
You don't need to do separate redirects to put everything in the same place,<br>
exec &>/tmp/rc.local.log<br>
will do it, and make it clear what your doing. Interestingly, if you are<br>
running from a terminal, you can "echo foo >&0" and still write the terminal<br>
as long as STDIN is the terminal.<br>
2 - directories<br>
When you run a command, script or not, you may not be in the directory you<br>
expect, or have the right PATH. When running from rc.local, you will be<br>
starting as root (unless you use su) in /root, using the root PATH.<br>
The trick is to force a login as yourself:<br>
su -c 'My cmd1; My cmd2' >My_log_optional - My-username<br>
This will get you in your usual login directory, PATH, and UID.<br>
3 - more on directories and PATH<br>
when you run a command with the 'batch' or 'at' commands, they<br>
start in the current directory, and in most cases the current<br>
PATH and UID.<br>
<br>
Sometimes when I create working files, logs, command output, I want<br>
to save for a few days. I use the 'at' command to delete them in a few days<br>
so I leave less clutter if I don't use them. Starting in the current<br>
directory is a benefit if you remember it will happen.<br>
4 - logging<br>
For crying out loud use the damn logger command to log stuff like<br>
rc.local:<br>
logger -t rc.local Started<br>
# or on commands, use || to log fails:<br>
My_cmd1 || logger -t rc.local "My_cmd1 exit with $! status"<br>
# and when done:<br>
logger -t rc.local "Complete, reached end"<br>
Then you have a trail in the system log which you can find:<br>
grep rc.local /var/log/messages<br>
You can still put errors from a command in a file of its own, if<br>
that provides documentation, but the note in the log remains you<br>
it failed.<br>
<br>
Hope this is going to help the original problem and some others as well.<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Bill Davidsen <<a href="mailto:davidsen@tmr.com" target="_blank">davidsen@tmr.com</a>><br>
"We have more to fear from the bungling of the incompetent than from<br>
the machinations of the wicked." - from Slashdot</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
-- <br>
users mailing list<br>
<a href="mailto:users@lists.fedoraproject.org" target="_blank">users@lists.fedoraproject.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/users" target="_blank">https://admin.fedoraproject.<u></u>org/mailman/listinfo/users</a><br>
Fedora Code of Conduct: <a href="http://fedoraproject.org/code-of-conduct" target="_blank">http://fedoraproject.org/code-<u></u>of-conduct</a><br>
Guidelines: <a href="http://fedoraproject.org/wiki/Mailing_list_guidelines" target="_blank">http://fedoraproject.org/wiki/<u></u>Mailing_list_guidelines</a><br>
Have a question? Ask away: <a href="http://ask.fedoraproject.org" target="_blank">http://ask.fedoraproject.org</a><br>
</div></div></blockquote></div><br></div>