LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rsync between windows and linux (https://www.linuxquestions.org/questions/linux-newbie-8/rsync-between-windows-and-linux-4175538524/)

aavika 04-07-2015 02:01 AM

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

aavika 04-07-2015 02:06 AM

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

pan64 04-07-2015 02:09 AM

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>

aavika 04-07-2015 02:14 AM

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

pan64 04-07-2015 02:23 AM

?
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.

aavika 04-07-2015 02:24 AM

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"

aavika 04-07-2015 02:27 AM

sorry.. by mistake i posted again..

aavika 04-07-2015 02:32 AM

how to run that file in cron tab??

aavika 04-07-2015 02:49 AM

please help me.. its urgent! today is deadline..:(

pan64 04-07-2015 03:29 AM

crontab -e
is used to edit a cron
see man crontab and man cron about details

aavika 04-07-2015 03:44 AM

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

pan64 04-07-2015 03:52 AM

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

pan64 04-07-2015 04:03 AM

(duplicate)

JeremyBoden 04-07-2015 04:08 AM

Quote:

Originally Posted by aavika (Post 5343705)
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.

aavika 04-07-2015 04:33 AM

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?


All times are GMT -5. The time now is 02:31 AM.