Hallo,
I use keychain in order to download a web site backup on my desktop at night. For that reason I have added the appropriate commands on ~/.profile, meaning my ~/.profile now, has the following 2 lines:
keychain id_dsa
. ~/.keychain/$HOSTNAME-sh
The backup process runs as a cron job late at night. Unfortunatelly, either the ~/.profile is not the right place to add those lines (The article at IBM's Dev center,
http://www-106.ibm.com/developerwork...r-lnxw41Backup mentions the ~/.bash_profile), or the keychain is not working, because the cron jib stops with an "authentication required" mail message.
The keychjain is working, since I can connet passwordless at the remote server from the console. Thus, I have to find the correct place to add the above mentioned 2 lines.
If I add them on the backup script, o na few days the server will stop to respond, since for wach time the script is running a new ssh-agent id is running (and is not closed).
Is it save to add a new file on my home dir named ~/.bash_profile?
The above mentioned problem will be solved if I can "force" cron to load user's settings (either from bashrc, or from bash_profile). Since, no one answered anything, I have to ask something else. When a user logs in (let's say a console), the ~/.basrc file ir read in order to load any changes.
But, (please correct me if I am wrong), when a cron job is running the ~/.barc file is not read. Which file is read? Is it possible to "force" cron to read the bashrc file?
Thank you in advance.