LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-02-2018, 02:27 PM   #16
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 29

Quote:
The rsync command runs when entered in to the command line, so does that tell me its correct?
Because your shell uses $PATH to determine the folders where to look into

There used to be FHS. as these days no one really cares where they store the binaries and config files you better check where the binary really is. Also they do not respect runlevels these days

e.g. gentoo
Quote:
ASUS-G75VW /usr/src/linux # equery belongs rsync
* Searching for rsync ...
..
net-misc/rsync-3.1.2-r2 (/usr/bin/rsync)
...
 
Old 01-02-2018, 04:20 PM   #17
stigslim
LQ Newbie
 
Registered: Dec 2017
Posts: 26

Original Poster
Rep: Reputation: Disabled
So check where it is to be able to run it?. How would i do this?>
 
Old 01-02-2018, 07:31 PM   #18
Deviathan
Member
 
Registered: Dec 2005
Posts: 52

Rep: Reputation: 18
The / in /rsync is throwing off your cli. It's looking for the rsync executable in the root / and not finding it, so it does not execute anything. In your crontab, remove the / from in front your rsync command, or change it to the full path which is something more like /usr/bin/rsync.
 
2 members found this post helpful.
Old 01-03-2018, 02:17 AM   #19
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
see post #14 again, I suggested a solution too. The problem is not the rsync executable, but the string /rsync in your crontab, which is incorrect.
 
1 members found this post helpful.
Old 01-04-2018, 11:29 AM   #20
stigslim
LQ Newbie
 
Registered: Dec 2017
Posts: 26

Original Poster
Rep: Reputation: Disabled
I removed the / before rsync with no luck.


*/5 * * * * /opt/bin/transmission-scheduler.sh

/0 3 * * * rsync -av --delete /tmp/.cemnt/mnt_sdb1/Backup /tmp/.cemnt/mnt_sdc1/
 
Old 01-04-2018, 03:09 PM   #21
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,623

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Quote:
Originally Posted by stigslim View Post
I removed the / before rsync with no luck.


*/5 * * * * /opt/bin/transmission-scheduler.sh

/0 3 * * * rsync -av --delete /tmp/.cemnt/mnt_sdb1/Backup /tmp/.cemnt/mnt_sdc1/
Change the
Quote:
/0 3 * * * rsync
to
Quote:
0 3 * * * rsync
and you will get a run at 03:00 daily. What exactly the "/0 3" would do I am not sure. It kicks out an error on mine and will not accept that.
 
1 members found this post helpful.
Old 01-05-2018, 03:36 AM   #22
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
use rsync with full path, like: /usr/bin/rsync
 
1 members found this post helpful.
Old 01-05-2018, 12:59 PM   #23
stigslim
LQ Newbie
 
Registered: Dec 2017
Posts: 26

Original Poster
Rep: Reputation: Disabled
Going with what has been said i changed the path to.

File: crontab

*/5 * * * * /opt/bin/transmission-scheduler.sh

2 0 * * * /opt/bin/rsync -av --delete /tmp/.cemnt/mnt_sdb1/Backup /tmp/.cemnt/mnt_sdc1/

Which should run at 8PM but still no luck. I'm running it from /opt as i assume this is where Optware installs the packages, is there a chance it could be somewhere else?>
 
Old 01-05-2018, 01:17 PM   #24
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you don't need to assume, but check:
Code:
ls -l /opt/bin/rsync /usr/bin/rsync /bin/rsync
and you will see immediately.
 
1 members found this post helpful.
Old 01-05-2018, 01:21 PM   #25
stigslim
LQ Newbie
 
Registered: Dec 2017
Posts: 26

Original Poster
Rep: Reputation: Disabled
This was the ouput.

# ls -l /opt/bin/rsync /usr/bin/rsync /bin/rsync
ls: /usr/bin/rsync: No such file or directory
ls: /bin/rsync: No such file or directory
-rwxr-xr-x 1 root root 366456 Feb 15 2012 /opt/bin/rsync


Where does it point to, if anywhere?.
 
Old 01-05-2018, 01:41 PM   #26
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
the first two do not exist, the third one was ok, so you have /opt/bin/rsync
Now you can try something like this:
Code:
2 0 * * * /opt/bin/rsync -av --delete /tmp/.cemnt/mnt_sdb1/Backup /tmp/.cemnt/mnt_sdc1/ >/tmp/rsync.log 2>/tmp/rsync2.log
and check the content of /tmp/rsync.log and /tmp/rsync2.log later..
 
1 members found this post helpful.
Old 01-05-2018, 04:00 PM   #27
stigslim
LQ Newbie
 
Registered: Dec 2017
Posts: 26

Original Poster
Rep: Reputation: Disabled
How would i view a log file? is this done using an editor or just an output command. I have looked in /tmp but dont see an rsync log file, thats if i'm doing it correctly.

Last edited by stigslim; 01-06-2018 at 04:15 AM.
 
Old 01-06-2018, 04:25 AM   #28
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
there are two logfiles, and you can view them with your favorite text editor, it is a plain text file.
If they were empty (or even not created) that would mean cron is not trying to execute that line at all, most probably it is still incorrect.
check this page: http://manpages.ubuntu.com/manpages/...n8/cron.8.html
you may try to run cron from command line as: cron -f -L 15 and it will print when it tries to start that rsync. Or print an error message....
 
Old 01-06-2018, 11:46 AM   #29
stigslim
LQ Newbie
 
Registered: Dec 2017
Posts: 26

Original Poster
Rep: Reputation: Disabled
There are no log files created, which would mean its still not executing the line i wrote, is there a simple cron job that i can give it to see if its my job or the cron itself?. Cron -f and -L return errors.

# cron -f -L 15
cron: invalid option -- 'f'
usage: cron [-n] [-x [ext,sch,proc,pars,load,misc,test,bit]]
~ #

Its showing test a useable which i ran but not sure where the output goes(checked the tmp for a log)
 
Old 01-07-2018, 05:43 AM   #30
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,840

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
in post #7 you told:
Quote:
cron - 4.1-9 - Standard vixie cron, with cron.d addition
looks like it has different syntax, so probably you need to check how should it be configured.
What I found is:
Code:
2 0 * * * username /opt/bin/rsync -av --delete /tmp/.cemnt/mnt_sdb1/Backup /tmp/.cemnt/mnt_sdc1/ >/tmp/rsync.log 2>/tmp/rsync2.log
probably you need to specify a username too, but I'm not really sure about that.
 
1 members found this post helpful.
  


Reply



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
advice for a begginer ApacheOmega Red Hat 21 04-12-2015 09:30 AM
please help me IM BEGGINER IN LINUX.. gkarthik078 Linux - Kernel 6 06-29-2011 03:08 AM
LXer: Absolute Linux is an absolute winner LXer Syndicated Linux News 0 08-07-2007 06:32 PM
Perl Begginer Cool_Hand_Luke Programming 6 03-11-2005 04:34 PM
For begginer,where can I start NoThing Linux - General 1 08-03-2004 12:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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