Announcement

Collapse
No announcement yet.

Scripts - how to run one?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scripts - how to run one?

    I have a script to run rsync.

    #!/bin/sh
    sudo mount -t smbfs -o username=jon,mode=755,uid=1000 //192.168.2.2/jon/ /mnt/ting
    sudo rsync --verbose --progress --stats --compress --rsh=/usr/local/bin/ssh --recursive --times --perms --links --delete --exclude "*bak" --exclude "*~" /home/jon/ /mnt/ting/

    I have saved it as 'rsyncscript' on the Desktop. Right click, choose Properties and tick 'Make it executable'
    I click it, double click it, go into Konsole and type 'rsyncscript'
    Nothing seems to happen. How should I run it, please?

    #2
    Re: Scripts - how to run one?

    I don't believe that sudo will work inside a script. I have not tested it, but I have some vague memories of having problems with it before.

    I usually sudo the script instead of putting the sudo inside the script. I mean, I'd remove all that sudos and just call the script like that:

    Code:
    $ sudo rsyncscript
    Javier.

    Comment

    Working...
    X