Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 02 Sep 2014, 22:10
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Pschedule 1.1.5 - Task on time
Post new topic   Reply to topic View previous topic :: View next topic
Page 8 of 9 [130 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8, 9 Next
Author Message
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Wed 24 Oct 2012, 02:19    Post subject:  

don570 wrote:
Shinobar puts the following code in his apps.
I have been doing the same recently.
It allows the scripts to run on more distributions

Code:


for P in gtkdialog4 gtkdialog3 gtkdialog; do
    GTKDIALOG=$(which $P) && break
  done
 


________________________________________

Yes, I see. I will improve this, but the above code will not work as gtkdialog3 will not run pSchedule and I would switch the order to run gtkdialog if available. I assume that gtkdialog will be the latest.


Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Sat 08 Dec 2012, 14:07    Post subject:  

Version 1.1.0
See main post


Changelog
- NLS is supported by gettext.
- Simplified edit/add gui.
- Improved scaling og gui.
- Code cleanup.
- Skip lines in crontab that starts with #. (thanks to miriam)
- gtkdialog is now only supported executable - no gtkdialog(x).

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Wed 12 Dec 2012, 16:49    Post subject:  

Version 1.1.1
See main post

Changelog
- Updated 'About' box.
- Bugfix: Minor syntax changes.

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
zigbert


Joined: 29 Mar 2006
Posts: 5701
Location: Valåmoen, Norway

PostPosted: Sat 15 Dec 2012, 18:46    Post subject:  

Version 1.1.2
See main post

Changelog
- new switch -n (set new task)


the -n switch is used by pMusic 3.1

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3263
Location: Ontario

PostPosted: Mon 14 Jan 2013, 20:03    Post subject:  

When I installed version 1.1.1 in the distro Carolina
I got a strange warning that 'cron gtkdialog' was needed.

It seems to be working allright. I'll continue to test with version 1.1.2.


EDIT: other apps are showing the same warning when
I install in Carolina so it must be a bug in Carloina





_________________________________________________
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Wed 16 Jan 2013, 02:19    Post subject:  

Hi. Is there any way to save events entered into pschedule other than during the shutdown save. These days I'm just turning off the pc instead of going through normal shutdown to maintain the pup_save file unchanged. (also turned off periodic save). Of course this means that any pschedule events entered during the session are lost. Is there a way to force saving without a full pup_save save?

Thanks in advance.

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3263
Location: Ontario

PostPosted: Wed 16 Jan 2013, 21:15    Post subject:  

canbyte wrote:
Is there a way to force saving without a full pup_save save?


The crontab's are hidden away some where in the
system in a file . I'm not sure what its name is (but it has 'cron'
or 'crontab' in the name??)

In the terminal you can type.....
Code:
crontab -l  > crontab.txt


or...

Code:
crontab -e


Save the file for your reference.

__________________________________
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Thu 17 Jan 2013, 02:37    Post subject:  

Thanks don570.
I pfound the usr/bin/crontab file but it had a gear icon and wouldn't open with geany as text so I kept looking. Another file found, var/spool/cron/crontabs/root, was happy to open with geany as text and showed my list of events. From there, I just used the normal drag/copy procedure to place a copy on my flash drive which can then be recopied back to the var/spool/cron/crontabs directory when needed.

I'm sort of wondering if the root file can be moved or linked to the flash drive I put my files on or if this will cause system confusion during startup - ie the period after startup but before the flash drive is mounted. Hmm. I'll probably just go with the simple solution but would appreciate any thoughts on the idea.

Thanks again

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3263
Location: Ontario

PostPosted: Thu 17 Jan 2013, 21:12    Post subject:  

Writing a startup script is possible in Puppy. ie a script
that is launched every time you startup your computer.

It could automate the saving of the file 'root' every day (or hour)

Search in google under 'startup script + murga'
and see what is available

____________________________________
Back to top
View user's profile Send private message 
miriam


Joined: 06 Dec 2006
Posts: 268
Location: Queensland, Australia

PostPosted: Thu 17 Jan 2013, 22:56    Post subject:  

I have quite a few small scripts that I've put in my /root/Startup/ folder. Just write a simple script to do whatever it is you want, then when you're happy with it copy it to the Startup folder. It will be run each time you run Puppy.

Remember to set the executable attribute/permission flag (right-click it and check its "Properties). Also make sure the first line of the script is
Code:
#!/bin/sh
because that lets it be run as a command.

Off the top of my head I imagine you could do something like this:
Code:
#!/bin/sh
# restore previously saved crontab backup (if it exists)
if [ -e /root/crontab.bak ]; then
   cp  /root/crontab.bak  /var/spool/cron/crontabs/root
fi
# endlessly loop, backup crontab each hour
while [ true ]
do
   sleep 1h
   cp  /var/spool/cron/crontabs/root  /root/crontab.bak
done
It will restore the backup made last time this script ran (if it exists) and then start an endless loop that will make a backup of the current crontab every hour. Of course if you change your crontab and switch off your computer (without the standard shutdown sequence) before it has a chance to save the next backup then you'll still lose it. You could make the backup more frequent, but that shortens the life of flash memory if your storage is on flash drive. Or you could make the loop run faster with a delay of just 5 minutes, but check if the crontab has changed so that it only needs to be backued up if an alteration has been made. There are several ways you could check if the file has changed. Perhaps you could use the diff command.

Or maybe test the file with if [ -N /var/spool/cron/crontabs/root ] test to see if the file has been modified since it was last accessed (not sure if that would work because I don't know how often cron accesses the file).

Using diff would seem to be the easiest. Here is an example of how to test:
Code:
if [ "`diff /var/spool/cron/crontabs/root  /root/crontab.bak`" != "" ]; then
   cp  /var/spool/cron/crontabs/root  /root/crontab.bak
fi

because diff doesn't print anything, so it is an empty string, if the two files are the same. But we want to do the copy if they are different -- that is, if the output of diff is not identical to "", so we use != which means not identical to. The backticks (`...`) around the diff command lets us run the command and insert the result into the test. It then has to be inside quotes so that it can be tested as a string.

So your end result might look something like this:
Code:
#!/bin/sh
# restore previously saved crontab backup (if it exists)
if [ -e /root/crontab.bak ]; then
   cp  /root/crontab.bak  /var/spool/cron/crontabs/root
fi
# endlessly loop, backup crontab each ten minutes if it has changed
while [ true ]
do
   sleep 10m
   if [ "`diff /var/spool/cron/crontabs/root  /root/crontab.bak`" != "" ]; then
      cp  /var/spool/cron/crontabs/root  /root/crontab.bak
   fi
done

Hope this helps.

_________________
A life! Cool! Where can I download one of those from?
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3263
Location: Ontario

PostPosted: Sat 19 Jan 2013, 17:34    Post subject:  

I think pschedule itself can be used to copy the file 'root'

to another partition like a USB stick on a scheduled basis.

I was able to do it but I'll need to check more.

_________________________________________________
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Sat 19 Jan 2013, 20:56    Post subject:  

You folks are totally incredible. I asked for 'thoughts' and you responded with invention and research galore. Wow, what puppies! It will take me awhile to digest and try all these ideas as there's a lot on my plate at the moment but I wanted to say thanks, I'm still here.

BTW, it occurs to me that this conversation is equally applicable to the browser's bookmarks and history files, which also disappear if I turn off without saving. Hmm. Maybe like that script miriam suggested??? Attached to a save icon on the desktop so one just clicks it before shutting down??? And a similar one for just after bootup??? (I'm trying to think if there are times when one might not want an automated script in the startup directory as suggested)

Thanks again.

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
miriam


Joined: 06 Dec 2006
Posts: 268
Location: Queensland, Australia

PostPosted: Sun 20 Jan 2013, 18:34    Post subject:  

Smile The sharing that people like to do if given a chance is one of the things that gives me great hope for humanity.

Some Puppy versions already use a save button to flush buffers and save settings in a flash-booted system. However, I think that if you do a controlled shutdown instead of simply switching off then that is effectively what the computer does -- it saves settings and unmounts flash drives after flushing buffers to them.

I find it annoying having to ask my computer to shut down, instead of just shutting it off, but these days it has its uses, especially when using blasted flash drives.

Flash drives are very convenient (compact, low power, high capacity, retain data without power), but are annoyingly fragile, requiring stuff to be written in large chunks instead of a byte at a time, which then means stuff is held back til enough is accumulated in a buffer to be written. As a result, pulling a flash drive out before a buffer is emptied to it leaves it, at worst corrupted, at best incomplete. I don't know why this is still a problem. Way back in the '80s when I used Amiga computers we had solved this. If a floppy disk was ejected in the middle of a write the Amiga put up a warning that the file hadn't been completely written and requested that you put the disk back in any drive, whereupon it resumed. We could have the same solution today, but all operating systems seem to have forgotten such old answers. [sigh]

Of course this is a problem for USB connections generally, not just flash drives. I'm currently repairing a large (1 terabyte) drive for a friend after it got corrupted when it was unplugged before a write completed. It was being used on MSWindows and formatted as NTFS (though Linux is not much safer). There is really no excuse for this kind of fragility. Maybe the next version of Linux's filesystem will be a partial solution.

Please excuse the rant. Smile

_________________
A life! Cool! Where can I download one of those from?
Back to top
View user's profile Send private message Visit poster's website 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Mon 21 Jan 2013, 22:47    Post subject:  

Hi Miriam. I enjoyed your rant - should be brought to the attention of puppy or linux designers. The reason I avoid the regular shutdown save is to avoid the gradual deterioration in performance that seems to go along with that. So Instead of saving everything into the _save file, perhaps a menu could be provided with options of what to save outside the _save file. I'll be trying to get my noobrain around your script idea to set something up as soon as the dust settles around here.

Another thing I've wondered is if this nice little scheduler can be set up for common committee schedules such as every other Wednesday, third Thursday of the month, reminder every other hour (instead of hourly), etc.?

Thanks

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
miriam


Joined: 06 Dec 2006
Posts: 268
Location: Queensland, Australia

PostPosted: Tue 22 Jan 2013, 17:35    Post subject:  

You could write a script containing a simple or not-so-simple list of what you want to do and invoke it on desired days using pschedule.

I think wed/2 in the day-of-week field will activate every second Wednesday. Best to read the documentation of cron (which is what pschedule is the front-end for). I'm not sure how you'd get cron (pschedule) to recognise the 3rd week of the month. I think there is a solution for the every-2nd-hour problem in the cron documentation.

Try
Code:
man cron
or
Code:
man crontab
on a commandline (crontab is the text file that holds all the scheduling info -- this is what pschedule displays), or use the Puppy help icon to lookup information. If that fails to give you the info look up the man page or articles online that discuss cron. The Linux Documentation Project http://tldp.org/docs.html has lots of great info, including all the manual pages for hundreds of Linux commands in an easily downloadable compressed file. The first couple of hundred issues of The Linux Gazette are online for free download at http://linuxgazette.net/ftpfiles/ and often contains useful articles and command tips. Issue 6 includes a short article about cron http://linuxgazette.net/ftpfiles/lg-issue01to08.tar.gz (you'll also need http://linuxgazette.net/ftpfiles/lg-base.tar.gz and possibly http://linuxgazette.net/ftpfiles/lg-base.tar.gz)

I keep an enormous reference directory (about 1.5GB) on my computers containing all the manuals (in html format) along with examples, useful articles I've found on the web, all the HOWTO documents and my own notes. This is so I can quickly look up almost anything I want at a moment's notice whether I'm near a net-connection or not. It seems like a lot, but it easily fits on the smallest flash drive these days -- a massive reference library in the palm of my hand. Smile

_________________
A life! Cool! Where can I download one of those from?
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 8 of 9 [130 Posts]   Goto page: Previous 1, 2, 3, ..., 6, 7, 8, 9 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1080s ][ Queries: 13 (0.0085s) ][ GZIP on ]