LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-09-2012, 10:48 AM   #1
gtrrockz84
Member
 
Registered: Dec 2011
Posts: 50

Rep: Reputation: Disabled
Post Writing a script in LuckyBackup


Hi Everyone,
I have luckybackup up and running and all seems good. But i want it to perform a chown and chmod command before it backs things from one drive to another. I installed Kwrite and but have no clue how to write the command in it and connect it to luckybackup. I tried writng the command in kwrite the way you would in terminal, then saved it and went to lucky backup and clicked the advanced button and browsed and opened the file in there. But when i run it it gives me some error command.

Please help me in how to write script/bashing for lucky backup (not sure what bash script is (i found that through googling))

Thanks a ton
 
Old 01-09-2012, 11:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Did you see the manual example: http://luckybackup.sourceforge.net/m...cedAlsoExecute ?
 
Old 01-10-2012, 12:59 PM   #3
gtrrockz84
Member
 
Registered: Dec 2011
Posts: 50

Original Poster
Rep: Reputation: Disabled
Thanks for your response. I did try writing "sudo chmod..." in the line and add it. But when i dry run it, it gives me error. I googled it and some people said that they wrote the commands in kwrite and then linked the file to the lucky backup. They added the file and that somehow automatically ran the code? So i tried that and even that didnt work .
 
Old 01-10-2012, 03:29 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
Create this text as a file using your favorite editor:
Code:
#!/bin/bash --
PROGNAME=${0//*\//}; 
logger -t "${PROGNAME//.*/}" "I just ran the "${PROGNAME}" script."
exit 0
Save it as "/usr/local/bin/testscript.sh" and run 'sudo chown root.root /usr/local/bin/testscript.sh; sudo chmod 0755 /usr/local/bin/testscript.sh' to set ownership. Now in the "Also Execute" field add the text "/usr/local/bin/testscript.sh" (w/o quotes). Run the backup test again and simultaneously run 'sudo tail /var/log/messages' in a terminal and you should see the above message scroll by.
 
Old 01-11-2012, 01:40 PM   #5
gtrrockz84
Member
 
Registered: Dec 2011
Posts: 50

Original Poster
Rep: Reputation: Disabled
hey thanks! Your post gave me some insight in figuring it out. I did what you said but i did not see the message scroll by. but i figure from your example on how to actually write a bash script. And then i did some more googling based on different errors i still kept getting and then found that sudo commands work on "lukcybackup super" and not the normal luckybackup. So i opened luckybackup super user and added the file that contained the bash script and it worked beautifully.

so far so good. Thanks for your help unSpawn!

For all who has similar issue that I had, I wrote a script in gedit, like:
Code:
#!/bin/bash
sudo chmod -R 755 /your/folder
exit 0
save that file as name.sh (or whatever name you want) and then open luckybackup super user, not the normal luckybackup. you can open luckybackup super user in under applications, system tools.
Go to advance, and in the also execute field just add the name.sh file in there.

Use whatever command is applicable to you (ofcourse) instead of chmod. thats about it and it should run with no problem.
 
1 members found this post helpful.
  


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
speed of luckybackup and rsync-based backup in general SaintDanBert Linux - Desktop 0 05-30-2011 12:00 AM
How do I use luckybackup to backup files to an external hard drive in ubuntu 10.10 ? mansour Linux - Newbie 24 05-12-2011 10:52 PM
[SOLVED] Installation of backup software luckybackup fails in ubuntu 10.10 notebook edition mansour Linux - Newbie 3 05-08-2011 08:20 PM
(NeverMind) LuckyBackup Question joegumbo Linux - Software 1 03-27-2010 03:11 PM
LXer: Creating Backups With luckyBackup On An Ubuntu 9.04 Desktop LXer Syndicated Linux News 0 08-20-2009 12:41 PM


All times are GMT -5. The time now is 04:55 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