2

I am trying to mount remote server partition to put backup. I already have th perl script to take backup of data. I trying to add the mount command in the script. The below is the script, Please guide me how to do it.

If I run it on console it works and as well as with bash script. If I run this with perl its show mount error.

#!/usr/bin/perl
system ("mount -t cifs //192.168.178.39/Backup/Data\ folders /mnt/Backup/ -o username=xyz.com/abc.admin,password=12345@0312");

1 Answer 1

4

You need either to escape the backslash using \\ and @ using \@ (in this specific case, no need to escape the @ as it is followed by a digit. If it is followed by a letter, it will be considered as array).

system ("mount -t cifs //192.168.178.39/Backup/Data\\ folders /mnt/Backup/ -o username=xyz.com/abc.admin,password=12345\@0312");

, or use single quotes:

system ('mount -t cifs //192.168.178.39/Backup/Data\ folders /mnt/Backup/ -o username=xyz.com/abc.admin,password=12345@0312');
1
  • I tried with second one, It worked. Thanks ton buddy. :-) Mar 28, 2012 at 8:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .