You want to use the '--config-dir' option to let it know where to find the accepted cert (e.g. ~/.subversion by default).
That said, I'm almost certain you'd be better off calling svnsync from the hooks/post-commit script instead, as suggested elsewhere. Then your mirror is always in sync, rather than in sync with where your master was an hour ago.
One of the tricks I follow is to put #
in the beginning while using the rm
command.
root@localhost:~# #rm -rf /
This prevents accidental execution of rm
on the wrong file/directory. Once verified, remove #
from the beginning. This trick works, because in Bash a word beginning with #
causes that word and all remaining characters on that line to be ignored. So the command is simply ignored.
OR
If you want to prevent any important directory, there is one more trick.
Create a file named -i
in that directory. How can such a odd file be created? Using touch -- -i
or touch ./-i
Now try rm -rf *
:
sachin@sachin-ThinkPad-T420:~$ touch {1..4}
sachin@sachin-ThinkPad-T420:~$ touch -- -i
sachin@sachin-ThinkPad-T420:~$ ls
1 2 3 4 -i
sachin@sachin-ThinkPad-T420:~$ rm -rf *
rm: remove regular empty file `1'? n
rm: remove regular empty file `2'?
Here the *
will expand -i
to the command line, so your command ultimately becomes rm -rf -i
. Thus command will prompt before removal. You can put this file in your /
, /home/
, /etc/
, etc.
OR
Use --preserve-root
as an option to rm
. In the rm
included in newer coreutils
packages, this option is the default.
--preserve-root
do not remove `/' (default)
OR
Use safe-rm
Excerpt from the web site:
Safe-rm is a safety tool intended to prevent the accidental deletion
of important files by replacing /bin/rm with a wrapper, which checks
the given arguments against a configurable blacklist of files and
directories that should never be removed.
Users who attempt to delete one of these protected files or
directories will not be able to do so and will be shown a warning
message instead:
$ rm -rf /usr
Skipping /usr
Best Answer
Cron always runs with a mostly empty environment.
HOME
,LOGNAME
, andSHELL
are set; and a very limitedPATH
. It is therefore advisable to use complete paths to executables, and export any variables you need in your script when usingcron
.There are several approaches you can use to set your environment variables in
cron
, but they all amount to setting it in your script.Approach 1:
Set each variable you need manually in your script.
Approach 2:
Source your profile:
. $HOME/.bash_profile
(or. $HOME/.profile
)(You will usually find that the above file will source other files (e.g.
~/.bashrc
-->/etc/bashrc
-->/etc/profile.d/*
) - if not, you can source those as well.)Approach 3:
Save your environment variables to a file (run as the desired user):
Then import via your cron script:
Approach 4:
In some cases, you can set global
cron
variables in/etc/default/cron
. There is an element of risk to this however, as these will be set for allcron
jobs.