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 Mon 14 Oct 2019, 19:54
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to make a temp folder in spot? (Solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [11 Posts]  
Author Message
DuMar

Joined: 28 Jan 2016
Posts: 47
Location: Apeldoorn, Netherlands

PostPosted: Sat 27 Oct 2018, 05:46    Post subject:  How to make a temp folder in spot? (Solved)
Subject description: Xenial 32 7.5 frugal
 

Xenial 32 7.5 frugal

I would like to have a tmp folder in spot to place downloads from slimjet in. After closing/saving the folder should be emptied so it's clean again after a new bootup.

Last edited by DuMar on Sat 27 Oct 2018, 14:17; edited 1 time in total
Back to top
View user's profile Send private message 
Packetteer


Joined: 12 May 2012
Posts: 67
Location: Long Island Ny

PostPosted: Sat 27 Oct 2018, 06:14    Post subject:  

Hi DuMar
If you are using a savefile then you can use the root/downloads folder to save what you download. Your browser is probably set to save files to the root/downloads folder. As long as you do not save to your save file then what is in the root/downloads folder will not be there when you re boot.

Best Regards
John
Back to top
View user's profile Send private message 
DuMar

Joined: 28 Jan 2016
Posts: 47
Location: Apeldoorn, Netherlands

PostPosted: Sat 27 Oct 2018, 06:17    Post subject:  

Hi John, thank you for your answer.

This slimjet browser is saving in spot/downloads. After shutdown those files will be saved. That's why I like to also have a temp folder in spot.
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 3398
Location: 500 seconds from Sol

PostPosted: Sat 27 Oct 2018, 09:12    Post subject:  

Hi DuMar,

Packetteer is correct, Each time you bootup, the spot folder is created anew in RAM by reading files from your SaveFile/Folder. At reboot/shutdow, whatever is in RAM is cleared. However, if during a session you perform a Manual Save, or if you haven't turned off the Automatic Save* when a Save is executed whatever* you have in RAM is written to your SaveFile/Folder.
I recommend that you install Mike Walsh's spot-to-root pet. http://murga-linux.com/puppy/viewtopic.php?p=985040#985040, not only for its convenience in getting downloaded files out of the spot folder, but also because files downloaded into that folder have the wrong permissions --i.e. not proper for running as root.
Once you install it, you can modify it as to where you want downloaded files to be transfered. Just file browse to /usr/local/bin, and open spot-to-root in a text editor.
If you compare Mike Walsh's original to my modified text you'll get the idea:

-=-=-=-=-=-=-=-=-=-=-=-=-
#!/bin/sh
#
# spot chown script to return ownership to root & move files between directories - Mike Walsh (02/02/17)
#
# Move contents of /home/Spot/Downloads to intermediate folder, change ownership, then move those files to your 'Downloads' folder
#
mv -v /home/spot/Downloads/* /usr/share/Spot2Root/
mv -v /root/spot/Downloads/* /usr/share/Spot2Root/
chown root:root -R /usr/share/Spot2Root/
mv -v /usr/share/Spot2Root/* /mnt/home/my-stuff/Downloads
defaultfilemanager /mnt/home/my-stuff/Downloads
#
# yad notification
#
yad --info --geometry=300x130+360+250 --no-buttons --window-icon=/usr/local/share/icons/green-tick.png --title="SUCCESS!" --text=" FILE TRANSFER COMPLETE

-----------------------------------------------

Your files have now been successfully
transferred to your Downloads folder
with standard Puppy ROOT:ROOT ownership." --timeout=10
-=-=-=-=-=-=-=-=-=-=-=-

Mike Walsh now builds Chrome-&-Clones to use /home/spot. Other Chrome-&-Clones use /root/spot. The modification moves (mv) files from a spot/download folder, where ever it may be.
The folder /usr/share/Spot2Root is used to hold files temporarily while their permissions are changed.
The line "defaultfilemanager /mnt/home/my-stuff/Downloads" immediately opens my download folder, You'll notice it is somewhere on /mnt/home --which is always 'On Storage" rather than RAM.

* See this thread "Remove automatic pupsave for frugal installs". Unless you're running a Puppy more than 3 years old, you can probably start from here:http://murga-linux.com/puppy/viewtopic.php?p=841745#841745
Back to top
View user's profile Send private message 
DuMar

Joined: 28 Jan 2016
Posts: 47
Location: Apeldoorn, Netherlands

PostPosted: Sat 27 Oct 2018, 14:17    Post subject:  

Thank you Mike for your suggestions.

My system makes a backup to the savefile at closing. That means the downloadsfolder in spot is not empty after the next startup.

After taking a close look at mikewalsh script I did the following:

I made a directory /Mail in the directory /spot/Downloads

I took from the script only the last line, changed it in:

rm -rf ~/spot/Downloads/Mail/*

and made an autostart script from it.

Now when I have a html coded e-mail in Sylpheed I choose "save as" from the right click menu and save it as 1.html in the spot/Downloads/Mail folder.

I go to the folder and click the mail and read it in Slimjet.

After the next startup the folder spot/Downloads/Mail is empty again.

Probably technically not the most sophisticated solution but I can almost not believe it I have made this work. Puppy is so fantastic. I love it. Shocked Very Happy
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 1260
Location: Connecticut, United States

PostPosted: Sat 27 Oct 2018, 15:05    Post subject:  

for an experiment....have you tried to symlink /initrd/mnt/tmpfs/tmp/Mail to /root/spot/Mail ??
Create a directory in /tmp called /Mail that is owned by spot then symlink it to the /root/spot/Mail
something like
Code:
mkdir /initrd/mnt/tmpfs/tmp/Mail
chown -R spot:spot /initrd/mnt/tmpfs/tmp/Mail
ln -s /initrd/mnt/tmpfs/tmp/Mail /root/spot/Mail


then set up Sylpheed to save to the ~/spot/Mail directory
maybe that would work .....
Back to top
View user's profile Send private message Visit poster's website 
mikeslr


Joined: 16 Jun 2008
Posts: 3398
Location: 500 seconds from Sol

PostPosted: Sat 27 Oct 2018, 15:28    Post subject:  

DuMar wrote:
...
Probably technically not the most sophisticated solution but I can almost not believe it I have made this work. Puppy is so fantastic. I love it. Shocked Very Happy


Yah. Laughing That --and the friendliness of this Forum-- are what keeps me coming back. While it is true that 'a little knowledge is a dangerous thing', it is really surprising how quickly someone with no prior coding experience can make sense out of many of the commands bash --and thus Puppy-- uses.
Back to top
View user's profile Send private message 
DuMar

Joined: 28 Jan 2016
Posts: 47
Location: Apeldoorn, Netherlands

PostPosted: Sun 28 Oct 2018, 05:31    Post subject:  

rockedge wrote:
for an experiment....have you tried to symlink /initrd/mnt/tmpfs/tmp/Mail to /root/spot/Mail ??
Create a directory in /tmp called /Mail that is owned by spot then symlink it to the /root/spot/Mail
something like
Code:
mkdir /initrd/mnt/tmpfs/tmp/Mail
chown -R spot:spot /initrd/mnt/tmpfs/tmp/Mail
ln -s /initrd/mnt/tmpfs/tmp/Mail /root/spot/Mail


then set up Sylpheed to save to the ~/spot/Mail directory
maybe that would work .....


Thank you Rockedge, I tried to make it work and it works. However after closedown and startup the directory in initrd/mnt/tmpfs/tmp is gone and not created again.

I think there is a solution for that too?
Back to top
View user's profile Send private message 
DuMar

Joined: 28 Jan 2016
Posts: 47
Location: Apeldoorn, Netherlands

PostPosted: Sun 28 Oct 2018, 05:37    Post subject:  

mikeslr wrote:
While it is true that 'a little knowledge is a dangerous thing', it is really surprising how quickly someone with no prior coding experience can make sense out of many of the commands bash --and thus Puppy-- uses.


True words Mike, but there is nothing my backup savefile can't put straight when things go wrong.
Most times the button "don't save at closedown" is already sufficient Rolling Eyes
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 1260
Location: Connecticut, United States

PostPosted: Sun 28 Oct 2018, 12:38    Post subject:  

Quote:
I think there is a solution for that too?


Try in /root/Startup to create a script that will at system start create the
directory, set the ownership and make the symlink like before:

/root/Startup/make_Mail_dir

Code:
#!/bin/sh
mkdir /initrd/mnt/tmpfs/tmp/Mail
chown -R spot:spot /initrd/mnt/tmpfs/tmp/Mail
ln -s /initrd/mnt/tmpfs/tmp/Mail /root/spot/Mail


make sure you make the script /root/Startup/make_Mail_dir executable!
Back to top
View user's profile Send private message Visit poster's website 
DuMar

Joined: 28 Jan 2016
Posts: 47
Location: Apeldoorn, Netherlands

PostPosted: Mon 29 Oct 2018, 15:42    Post subject:  

rockedge wrote:


Code:
#!/bin/sh
mkdir /initrd/mnt/tmpfs/tmp/Mail
chown -R spot:spot /initrd/mnt/tmpfs/tmp/Mail
ln -s /initrd/mnt/tmpfs/tmp/Mail /root/spot/Mail


make sure you make the script /root/Startup/make_Mail_dir executable!


That was the last part needed, I just left out the last line, the symlink is still there after startup.

Thnx Rockedge.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [11 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
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.0467s ][ Queries: 11 (0.0050s) ][ GZIP on ]