Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFolder?
Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFolder?
Maybe someone is EXCELLENT in programming because i am not so i ask for help here.
SETTINGS:
PORTEUS on a USB drive, Boot to RAM
PROBLEM:
I need a command for "GUIEXEC" which will
COPY FOLDER "TEST" from USB drive (DRIVE LETTER MAY BE DIFFERENT, is there any variable with this data set?) to
1)DRIVE "F:"
2)Desktop
I ask for any help
Thank you
Gregor
SETTINGS:
PORTEUS on a USB drive, Boot to RAM
PROBLEM:
I need a command for "GUIEXEC" which will
COPY FOLDER "TEST" from USB drive (DRIVE LETTER MAY BE DIFFERENT, is there any variable with this data set?) to
1)DRIVE "F:"
2)Desktop
I ask for any help
Thank you
Gregor
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
^ You are talking windoze, so we have to wait for Ed_P, the windoze transition guy, to help you.
Welcome to Porteus.
Welcome to Porteus.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
- Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
I don't think I qualify. gregor001 is look for someone "EXCELLENT in programming" which i think better fits you.Bogomips wrote:^ You are talking windoze, so we have to wait for Ed_P, the windoze transition guy, to help you.
I'm afraid I have more questions than help for you Gregor.
What is "GUIEXEC"??gregor001 wrote:PROBLEM:
I need a command for "GUIEXEC" which will
The same USB drive Porteus is booted from?COPY FOLDER "TEST" from USB drive
Is "DRIVE "F:"" another USB drive or a partition on a harddrive? And I assume "Desktop" refers to the Porteus desktop.to
1)DRIVE "F:"
2)Desktop
Is the version of Porteus you are working with the Kiosk version?
Ed
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
@Ed Think in mind is guiexec= bootcode. Was going to suggest a simple script (two-liner), but then when it got to drive F, out of depth. WinMe was when my hard drive gave out. IMHO you are better placed here.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
- Ahau
- King of Docs
- Posts: 1331
- Joined: 28 Dec 2010, 15:18
- Distribution: LXDE & Xfce 32/64-bit
- Location: USA
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
Are you looking to do this on one computer (only) where it will always be the same USB drive and the same hard drive (assuming F:\ is a hard drive?) or do you need something that will work using multiple USB drives on multiple computers? This will be relatively straightforward if it's only for one USB drive (or if it is always from the same partition Porteus is booted from) and one hard drive, but I think it will require more gymnastics if this needs to be extensible to work across any hardware.
you will need a script placed in one of the folders in your $PATH, this script will do the work. Then you'll call the script with the guiexec= cheatcode.
For example, "copymyfiles" gets placed in /usr/bin and marked executable. Then you'll boot with "guiexec=copymyfiles" (no quotes in the actual line).
We can help you a bit with the script when we know more about what you're doing. I think you can use UUID's to find the correct drives if you will always be using the same drives. If not, you might need to use something like a signature file or some other trick to know that you're pointing to the right drive.
you will need a script placed in one of the folders in your $PATH, this script will do the work. Then you'll call the script with the guiexec= cheatcode.
For example, "copymyfiles" gets placed in /usr/bin and marked executable. Then you'll boot with "guiexec=copymyfiles" (no quotes in the actual line).
We can help you a bit with the script when we know more about what you're doing. I think you can use UUID's to find the correct drives if you will always be using the same drives. If not, you might need to use something like a signature file or some other trick to know that you're pointing to the right drive.
Please take a look at our online documentation, here. Suggestions are welcome!
- Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
OK, I think I understand this a little better at this point.
So, you make a script similar to this one to fit your needs:
copymyfolder.sh
And to make the script executable run this command for it:
chmod +x copymyfolder.sh
So, you make a script similar to this one to fit your needs:
copymyfolder.sh
Code: Select all
#!/bin/bash
BOOTDEV=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
folderTEST=$BOOTDEV/TEST
DriveF=/mnt/sda?/TEST # <--- Change the ? to the drive number seen in Porteus file manager for hdd DRIVE F:
if [ ! -d "$DriveF/" ]; then
mkdir $DriveF
fi
cp -u -v $folderTEST/* $DriveF/
cp -u -v $folderTEST/* /home/guest/Desktop/
chmod +x copymyfolder.sh
Ed
- Ahau
- King of Docs
- Posts: 1331
- Joined: 28 Dec 2010, 15:18
- Distribution: LXDE & Xfce 32/64-bit
- Location: USA
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
Yep. And if his hard drive and/or flash drive will remain the same physical piece of hardware but might change letters (sdb instead of sda, etc) you can query the uuid out of blkid:
Code: Select all
#must be set manually by user
BOOTUUID=ba155345-b858-4c96-9e21-13ba3ce84708
BOOTDEV=`blkid|grep $BOOTUUID|cut -d ':' -f1|cut -d '/' -f3`
folderTEST=/mnt/$BOOTDEV/TEST
Please take a look at our online documentation, here. Suggestions are welcome!
- Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
Actually querying the F: drive's Volume Label might offer more flexibility.
Code: Select all
#!/bin/bash
# must be set manually by user
drvFvlabel="???????????" # <----- Unique Volume Label of the DRIVE F:
BOOTDEV=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
folderTEST=$BOOTDEV/TEST
DriveF=`blkid | greg "$drvFvlabel"`
DriveF=/mnt/${DriveF:5:4}/TEST
if [ ! -d "$DriveF/" ]; then
mkdir $DriveF
fi
cp -u -v $folderTEST/* $DriveF/
cp -u -v $folderTEST/* /home/guest/Desktop/
Ed
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
If you are looking for a universal solution then UUID is the way to go. I have 15 partitions but blkid doesn't show a LABEL for all of them. Some have PARTLABEL set and some have LABEL set and others have nothing. UUID will remain constant even when other devices are added and drive letters are bumped.Actually querying the F: drive's Volume Label might offer more flexibility.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
Wow. I have a machine like that, partitions/drives C: - P:. I will have to try Porteus on it and see what blkid shows on it. All have volume labels under Windows.brokenman wrote:If you are looking for a universal solution then UUID is the way to go. I have 15 partitions but blkid doesn't show a LABEL for all of them.
I understand, and agree, but many new Porteus users may not relate to UUIDs. And there is no confirmation that this script will be run on a single machine.UUID will remain constant even when other devices are added and drive letters are bumped.
Ed
- Ahau
- King of Docs
- Posts: 1331
- Joined: 28 Dec 2010, 15:18
- Distribution: LXDE & Xfce 32/64-bit
- Location: USA
Re: Porteus "GUIEXEC" start COMMAND ----- How to AutocopyFol
Yes, UUID is a foreign concept, especially for someone coming from Windows. Like brokenman, I have several partitions without labels on them.
Here, we're looking at one script for one person's specific task, and I think UUID can be reasonably explained for that purpose. Another way to approach this would be to have the user place uniquely named files on the target drives and build the script to search for those. Porteus (and Slax before it, for that matter), use an .sgn, or "signature" file for this purpose to help locate the porteus data.
For example, the user would place a file at /mnt/sdb2/data/test/copyhere.sgn and /mnt/sdc1/home/Ahau/pastehere.sgn. The script would then search all mounted drives for the sgn file and when it finds the sgn file, it sets that as the target drive.
This requires a little more scripting and the clutter of the sgn files, but you could set it up so that it would work on several flash drives and several hard drives.
Here, we're looking at one script for one person's specific task, and I think UUID can be reasonably explained for that purpose. Another way to approach this would be to have the user place uniquely named files on the target drives and build the script to search for those. Porteus (and Slax before it, for that matter), use an .sgn, or "signature" file for this purpose to help locate the porteus data.
For example, the user would place a file at /mnt/sdb2/data/test/copyhere.sgn and /mnt/sdc1/home/Ahau/pastehere.sgn. The script would then search all mounted drives for the sgn file and when it finds the sgn file, it sets that as the target drive.
This requires a little more scripting and the clutter of the sgn files, but you could set it up so that it would work on several flash drives and several hard drives.
Please take a look at our online documentation, here. Suggestions are welcome!