Find the answer to your Linux question:
Results 1 to 3 of 3
Hello all! Not sure if this qualifies as a "newbie" post, but I can't yet call myself a pro so I'll set it here. I have a Linux machine here ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! paveway's Avatar
    Join Date
    May 2011
    Location
    South Texas
    Posts
    18

    Mount, rsync, dismount. Backing up a windows share


    Hello all! Not sure if this qualifies as a "newbie" post, but I can't yet call myself a pro so I'll set it here.

    I have a Linux machine here at home that I use as a file server. My main computer is a Windows machine. Naturally, I installed samba on the Linux machine so that I can share the files with the Windows machine.

    What I want to do is write a script (my first script) that will backup all my music on my Windows machine every night. I do not, however, want the Windows share to always be mounted to the Linux machine. I want the script to mount the share, run the rsync to the directory of my choosing, and dismount the share.

    So the first thing I thought was just to write the three commands and throw it in the daily crontab. BUT... every time I mount the Windows share to my Linux machine it asks for a password. EVERY time. The Windows share does not have a password for it so I don't know why it is asking for one.

    Is there anything y'all suggest I do to overcome this? I'm really stuck at this point. Is there some other way I could do it? I would really like to stick to command line stuff only. I am trying my hardest to stay away from the gui and I know there has to be a way to do this from the command line.


    Thanks in advance!

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,529
    You don't say what distro you are running but you could try sudo crontab -e and give it your password when asked. This should run the cron job with elevated privileges.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  3. #3
    Just Joined! paveway's Avatar
    Join Date
    May 2011
    Location
    South Texas
    Posts
    18
    sorry, I forgot to mention that the password prompt is not for privileged access to mount, but rather to access the share on the windows machine (which is not protected by a password).

    Also, if it matters, I am running Debian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •