XFileSharing Pro - Adding cronjobs to the extra server

Message
Author
Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

Adding cronjobs to the extra server

#1 Postby Steve9e8 » Mar 17, 2015 1:26 pm

Hello

Should I add cronjobs to every extra server I add to my XFS ? ....
I think the answer is yes I should do. but the question is, how to do that ?

I need for an exact explanation for the following instruction :

Code: Select all

4) Add the cronjobs (don't to forget to replace /var/www/cgi-bin with your actual path): 
	*	*	*	*	*	cd /var/www/cgi-bin;./transfer.pl >/dev/null 2>&1

What is the right cgi path I should replace with ( var/www ) ...

Does it the XFS script path ( for example : /home/myhost/public_html | then the command is :

Code: Select all

cd /home/myhost/public_html/cgi-bin;./transfer.pl >/dev/null 2>&1
Or it's the new server path ( for example : http://91.***.***.34 |then the command is :

Code: Select all

cd http://91.***.***.34/cgi-bin;./transfer.pl >/dev/null 2>&1

Guneyd
Posts: 68
Joined: Mar 11, 2011 4:30 pm

Re: Adding cronjobs to the extra server

#2 Postby Guneyd » Mar 17, 2015 1:51 pm

The cronjob is for the file 'transfer.pl', so the directory path should be the directory in which the 'transfer.pl' is located.

So if your XFS is in /home/myhost/public_html it should become:

cd /home/myhost/public_html/cgi-bin;./transfer.pl >/dev/null 2>&1


As for your second question, the cronjob you setup on a server is meant for the files on that server.

cd http://91.***.***.34/cgi-bin;./transfer.pl >/dev/null 2>&1

So that wouldn't work.

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#3 Postby Steve9e8 » Mar 17, 2015 2:18 pm

I replaced "transfer.pl" before when I added XFS script and used the command :

Code: Select all

cd /home/myhost/public_html/cgi-bin;./transfer.pl >/dev/null 2>&1 
But for cronjob for the new server I add now, "transfer.pl" is located in the path:
192.***.***.***/cgi

then the command should be :

Code: Select all

cd http://192.***.***.***/cgi-bin;./transfer.pl >/dev/null 2>&1 
but when I try to replace in ssh I have error says :

-bash: cd: /192.***.***.***/cgi-bin: No such file or directory

Guneyd
Posts: 68
Joined: Mar 11, 2011 4:30 pm

#4 Postby Guneyd » Mar 17, 2015 9:48 pm

cd http://91.***.***.34/cgi-bin;./transfer.pl >/dev/null 2>&1

So that wouldn't work.

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#5 Postby Steve9e8 » Mar 18, 2015 4:58 am

No that command don't work ...

would you please tell me what is the right command that would work ?

Guneyd
Posts: 68
Joined: Mar 11, 2011 4:30 pm

#6 Postby Guneyd » Mar 18, 2015 5:29 am

Steve9e8 wrote:No that command don't work ...

would you please tell me what is the right command that would work ?
The same as what you did before:
cd /home/myhost/public_html/cgi-bin;./transfer.pl >/dev/null 2>&1

If you've got two servers. Let us say server1 and server2, both with a transfer.pl file.

The cronjob on server1 would be:

cd /home/server1/public_html/cgi-bin;./transfer.pl >/dev/null 2>&1

And the cronjob on server 2 would be:

cd /home/server2/public_html/cgi-bin;./transfer.pl >/dev/null 2>&1

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#7 Postby Steve9e8 » Mar 18, 2015 8:07 am

Yes it works in the server where I'm running XFS script ...

But in the 2nd server which I want to upload files, the path of cgi-bin folder is :

http://333.***.***.**/cgi-bin ... that means the command for cronjob setup should be :

Code: Select all

 cd http://333.***.***.**/cgi-bin;./transfer.pl >/dev/null 2>&1 
But it didn't work... Shell says :

Code: Select all

-bash: cd: http://333.***.***.**/cgi-bin: No such file or directory
so is it a syntax error ( the path of cgi in 2nd server is : /var/www/cgi-bin ) ?

Guneyd
Posts: 68
Joined: Mar 11, 2011 4:30 pm

#8 Postby Guneyd » Mar 18, 2015 6:31 pm

Steve9e8 wrote:Yes it works in the server where I'm running XFS script ...

But in the 2nd server which I want to upload files, the path of cgi-bin folder is :

http://333.***.***.**/cgi-bin ... that means the command for cronjob setup should be :

Code: Select all

 cd http://333.***.***.**/cgi-bin;./transfer.pl >/dev/null 2>&1 
But it didn't work... Shell says :

Code: Select all

-bash: cd: http://333.***.***.**/cgi-bin: No such file or directory
so is it a syntax error ( the path of cgi in 2nd server is : /var/www/cgi-bin ) ?
You're mistaking the website path for the directory path, there is a difference.

http://333.***.***.** is the website path, you need to find the directory path on your server.

For example, if you've got the directory:
/home/var/www/index.html it'll correlate with http://www.site.com/index.html

You need to find the directory in which your XFS distribution on the fileserver is located.

Add me on skype if you need any more help, I'll be back in a hour: http://pastebin.com/fQq264G4

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#9 Postby Steve9e8 » Mar 19, 2015 7:08 am

@Guneyd

Hello and thanks for the continuous help

I opened ( XFSConfig.pm ) of the extra server and found that path of cgi-bin is exactly the same default path of XFS installation guide :

Code: Select all

cd /var/www/cgi-bin;./transfer.pl >/dev/null 2>&1
which I suppose to replace " /var/www/ " in it with the actual path of cig-bin in my server, that why I tried to replace before with other paths because I thought I have to change the path of command in anyway !

Now I tried with that command and it seems works, at least until now because cron jobs annoying warning disappeared from my admin section ... I think if it didn't come back that means the command was right ...

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#10 Postby Steve9e8 » Mar 21, 2015 11:27 am

Unfortunately, cron jobs doesn't work constantly with me ...

After adding it to the main server then extra server by using the commands ( that exists in XFS script installation guide ) , the annoying warning of cron jobs disappears from admin section, but just for 3 or 4 hours, after that it comes again !

Then I need to add cronjobs again to the main server to be installed on script and so on !

How can I permanently add cron jobs to the main and extra servers ?

alex.sa
Posts: 11
Joined: Mar 08, 2014 4:45 pm

#11 Postby alex.sa » Mar 21, 2015 9:26 pm

Hey friend, this is very specific, will depend on the control panel you are using. If you are using some, and this path given by him is just one example.

In my case the way of my cron job is:

cd /home/username/web/mydomain.tld/cgi-bin;./transfer.pl >/dev/null 2>&1


Also note the permissions of these files are correct.

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#12 Postby Steve9e8 » Mar 22, 2015 6:30 am

alex.sa wrote:Hey friend, this is very specific, will depend on the control panel you are using. If you are using some, and this path given by him is just one example.

In my case the way of my cron job is:

cd /home/username/web/mydomain.tld/cgi-bin;./transfer.pl >/dev/null 2>&1


Also note the permissions of these files are correct.
Hello .... The paths I write to add cronjobs for both main and extra servers were derived from where cgi-bin folder are located in both of them, and I think I put the right paths in cronjobs commands ... because the commands works but the problems is they work just for short time and I need them to work permanently ...

For permissions :

The main server :
cron.pl *** 755
cron_deleted_email.pl *** 755
transfer.pl *** 755


The extra server :
transfer.pl *** 644

is it right values ?