andreknieriem / photobooth

A photobooth Web-Application for raspberry pi with gphoto2
https://photobooth.andrerinas.de/
MIT License
295 stars 163 forks source link

Picture copy to USB Stick #224

Closed Seppel0815 closed 3 years ago

Seppel0815 commented 4 years ago

Hey. Thanks for the wonderfull Photobooth-Tool and the Energy and time you Spend in this Projekt.

In my opinion it is a good idea if we have the option to mount a USB stick and copy the pictures onto it. - so that we can give the usb stick directly to the married couple.

My idea is: A new admin menu where you can see the number of images in the folders, the size of the folder and a button to mount/unmount a USB stick and copy the Field on it.

andi34 commented 4 years ago

Not sure why always the template is ignored :disappointed:

But maybe a hint for you how to do such in background without admin menu https://github.com/kcinnaySte/photobooth/commit/228d27ecc42cdf0e76ef3708f03a2e38eee22357

andi34 commented 4 years ago

You could try if using a symlink as data folder works for you. Create a data folder on your USB stick.

sudo -u www-data -s
cd /var/www/html
mv data databackup
ln -s /stick/data data
exit
sudo chown -R www-data:www-data /stick/data

(/stick/data can be adjusted to your mount point)

Exalik commented 4 years ago

Hello,

Thank you so much for this photobooth project !

I have tried to use an usb stick using the previous commands but the proprietary modification (using "sudo chown -R www-data:www-data /stick/data" command) is not allowed.

I need to resolve it before tomorrow morning as I need the photobooth for a weeding...

Thank's for your help....

Best regards,

Olivier

andi34 commented 4 years ago

Where's your stick found? /dev/sda? sudo blkid -o list -w /dev/null

andi34 commented 4 years ago

Not tested, but you'll tell if it works, adjust /dev/sda if needed.

sudo apt-get -y install ntfs-3g hfsutils hfsprogs exfat-fuse
sudo mkdir /stick

Now mount the stick, depending on the filesystem
FAT32

sudo mount -t vfat -o utf8,uid=www-data,gid=www-data,noatime /dev/sda /media/usbstick

NTFS

sudo mount -t ntfs-3g -o utf8,uid=www-data,gid=www-data,noatime /dev/sda /stick

HFS+

sudo mount -t hfsplus -o utf8,uid=www-data,gid=www-data,noatime /dev/sda /stick

exFAT

sudo mount -t exfat -o utf8,uid=www-data,gid=www-data,noatime /dev/sda /stick

ext4

sudo mount -t ext4 -o defaults /dev/sda /stick

Continue with the steps mentioned earlier:

sudo -u www-data -s
cd /var/www/html
mkdir /stick/data
mv data databackup
ln -s /stick/data data
exit

Source: https://jankarres.de/2013/01/raspberry-pi-usb-stick-und-usb-festplatte-einbinden/ Slightly adjusted for www-data user and group, also adjusted mount path.

If this does not work you could also setup a cron job to copy the images from /var/www/html/data to your stick.

Exalik commented 4 years ago

Thank's for this information

I do not understand how is made the link between /media/usbstick and /stick

Can you explain please ?

andi34 commented 4 years ago

Sorry, should be /stick

Edit: Updated earlier post with right path