LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-07-2015, 02:01 AM   #31
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled

is there any format to make .sh file?? because i wrte only rsync command.

now location of the file is C:\cygwin64\bin\backup.sh
 
Old 04-07-2015, 02:06 AM   #32
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
for permission : right click on the file -> properties -> security->to change the permission clickd on edit and tick the box of full control allow .. is it okay???

thank u so much for reply
 
Old 04-07-2015, 02:09 AM   #33
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,349

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
That is a simple text file, you need to list your commands line by line into it. You can read some tutorials about bash scripts to get a better view.
Usually it begins with:
Code:
#!/bin/bash
as the very first line.

For permission you need to use the tools of cygwin, not the tools of windows. That is the command chmod and chown (see man pages about usage).
For example you will set execute rights by:
chmod +x <filename>
 
Old 04-07-2015, 02:14 AM   #34
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
is there any format to make .sh file ? because i wrte only and only rsync command

for permission: right click on the file -> properties -> security-> edit -> tick the box of full contol allow is it okay?

now the location of file is: C:\cygwin64\bin\backup.sh
 
Old 04-07-2015, 02:23 AM   #35
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,349

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
?
You have already asked it and got an answer. I think you have another problem. Please post what have you tried and what's happened.
 
Old 04-07-2015, 02:24 AM   #36
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
okay i wrte command : chmod +x /cygdrive/c/cygwin64/bin/backup.sh in cygwin terminal.

and backup.sh file contents is like:

#!/bin/bash
rsync -av "/cygdrive/c/vjtest" "root@192.168.1.149:/home/backup"
 
Old 04-07-2015, 02:27 AM   #37
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
sorry.. by mistake i posted again..
 
Old 04-07-2015, 02:32 AM   #38
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
how to run that file in cron tab??
 
Old 04-07-2015, 02:49 AM   #39
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
please help me.. its urgent! today is deadline..
 
Old 04-07-2015, 03:29 AM   #40
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,349

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
crontab -e
is used to edit a cron
see man crontab and man cron about details
 
Old 04-07-2015, 03:44 AM   #41
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
i wrote crontab -e in cygwin terminal
and then i wrte:
*/5 * * * * / /cygdrive/c/cygwin64/bin/backup.sh
save and quit

checked list by using 'crontab -l'

but after 5 mints i checked, there is no 'vjtest' folder in /home/backup
 
Old 04-07-2015, 03:52 AM   #42
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,349

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
I don't know if cron was running on your host.
http://www.davidjnice.com/cygwin_cron_service.html
http://stackoverflow.com/questions/7...win-on-windows
 
Old 04-07-2015, 04:03 AM   #43
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,349

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
(duplicate)
 
Old 04-07-2015, 04:08 AM   #44
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,144

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by aavika View Post
i wrote crontab -e in cygwin terminal
and then i wrte:
*/5 * * * * / /cygdrive/c/cygwin64/bin/backup.sh
save and quit

checked list by using 'crontab -l'

but after 5 mints i checked, there is no 'vjtest' folder in /home/backup
The '/' (in red) shouldn't be there.
 
Old 04-07-2015, 04:33 AM   #45
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
okay.. still ouput is not coming.

backup.sh file contents is like:

#!/bin/bash
rsync -av "/cygdrive/c/vjtest" "root@192.168.1.149:/home/backup"

above rsync command if i type manually in cygwin terminal , it runs successfully
how this possible?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Options? rsync from Windows 7 to Linux haertig Linux - Software 1 03-19-2013 08:23 PM
rsync windows linux zerocool22 Linux - Server 4 05-23-2008 11:18 AM
How to rsync over ssh from Windows to Linux hareeshvv Linux - Networking 8 07-06-2006 10:11 PM
Rsync Backup From Windows To Linux Problem sectrean Linux - Networking 0 10-18-2004 04:11 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM


All times are GMT -5. The time now is 04:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration