LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 09: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, 10:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Did you see the manual example: http://luckybackup.sourceforge.net/m...cedAlsoExecute ?
 
Old 01-10-2012, 11:59 AM   #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, 02:29 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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, 12: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:42 PM.

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
Open Source Consulting | Domain Registration