Error while running Rsync through Crontab

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Error while running Rsync through Crontab
# 1  
Old 08-22-2013
Error while running Rsync through Crontab

hi All,

i have implemented Rsync in my source and destination server. while running through command prompt it is working fine:
ksh rsync_bravo_db.ksh /uv1402/u207/home/bravodba/bin/rsync-3.0.9/config/mrsx_rsync.cfg

but later on i created a another ksh and called this ksh from Crontab, as a result it gave following error:
Quote: rsync: fatal: open failed: No such file or directory
LD_LIBRARY_PATH is already defined in .bashrc file and in .profile file, but while using from crontab,it has given above problem. please suggest
# 2  
Old 08-22-2013
cron knows nothing about your environment... so you will have to also define all the variable it uses and find in your env like PATH etc...
# 3  
Old 08-22-2013
that's i have already done and mentioned the same variable in .profile file,like i have mentioned in my previous post.
# 4  
Old 08-22-2013
As vbe says, cron knows nothing about your environment (and it is NOT doing an interactive login) on your account. It's not going to run your .profile or .bashrc at all.

So you need to set any variables you need (eg. the one's you've put in your .profile and .bashrc) at the start of the script that cron runs.

Also, set any path(s) that are needed to find stuff in the script too.
# 5  
Old 08-22-2013
declared the variable in the same .ksh script now, it working..awesome

thanks a lot for this
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Setting Up Google 2F Authentication for Automated (Crontab) rsync

Dear All, I have Google Two Factor (2F) Authentication enabled for sshd on most of my Linux servers. This works well and I highly recommend it. My question is: Has anyone set this up for rsync which runs in a crontab? For example, supposed we have this simple crontab script: ... (5 Replies)
Discussion started by: Neo
5 Replies

2. Shell Programming and Scripting

Terminal running bash/rsync script does not close with exit (MacOS High SIerra)

Hello, I am running a bash script to do an rsync back on a computer running MacOS High Sierra. This is the script I am using, #!/bin/bash # main backup location, trailing slash included backup_loc="/Volumes/Archive_Volume/00_macos_backup/" # generic backup function function backup {... (12 Replies)
Discussion started by: LMHmedchem
12 Replies

3. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

4. Shell Programming and Scripting

Error while running Rsync

hi All, i am getting some error while running Rsync, and unable to find error at Google even, could anyone help me here please. ---------- Post updated 08-31-13 at 07:47 AM ---------- Previous update was 08-30-13 at 04:35 PM ---------- above problem got resolved because it was not... (4 Replies)
Discussion started by: lovelysethii
4 Replies

5. UNIX for Advanced & Expert Users

Rsync error while running from destination to source

hi All, i have 2 server setup now for Rsync, i configured Rsync on both of the server and it worked well when i did run from source to destination. and while running back from destination to source it produced this error: bash-3.2$ ksh rsync_bravo_db.ksh (0 Replies)
Discussion started by: lovelysethii
0 Replies

6. Shell Programming and Scripting

Crontab not running a script

Hi, I posted this in the Solaris forum but I think this one would be more appropriate. I created a script starting with the following lines: #!/usr/bin/ksh flag=n export flag typeset -i quant=0 (...) When running it I'm getting the following 2 errors: /tmp/tstscript/testfail.ksh:... (9 Replies)
Discussion started by: Cvg
9 Replies

7. UNIX for Dummies Questions & Answers

Getting error when running script through crontab

Hi all, I wrote small script for Solaris and when I am running it through command prompt its ok, but when I trying to run it using crontab, i am getting error like: dbloader: fatal: open failed: No such file or directory /tmp/ line 5: 8304 Killed ... (4 Replies)
Discussion started by: nypreH
4 Replies

8. UNIX for Dummies Questions & Answers

crontab job not running

Hi all, down here part of the scheduled job in crontab (AIX Version 5) i have problem running jspPRE-ALL. i verrify permissions and privileges (the others job are working good) if i run the job in command line it work correctly # # Aggiornamento doni e continuity 00 02 * * 2-6... (5 Replies)
Discussion started by: ilpasta
5 Replies

9. UNIX for Advanced & Expert Users

Crontab is not running!!!

Hi experts, need your helpo. after editing the crontab while saving the file it says- "/tmp/crontabRlaauT" 1 line, 77 characters cron may not be running - call your system administrator And i checked after certain time. script in cron is not running. I got a mail in user saying... (1 Reply)
Discussion started by: thepurple
1 Replies

10. UNIX for Dummies Questions & Answers

running sql in crontab

Hi, i have a scripts that update an SQL DATABASE using sqlplus command. when i run it in a interactive mode its ok but when try to run it using the crontab i get an a messege : "Must be attached to terminal for 'am I' option" (there is no "who am i" command in the script) and the DB... (4 Replies)
Discussion started by: dorilevy
4 Replies
Login or Register to Ask a Question