You are not logged in.


Hello.
I've set up rclone to automatically sync dropbox on login using the following simple script:
#!/bin/bash
printf "Sync from remote to local dropbox directory\n\n"
rclone sync -v --dropbox-batch-mode sync --transfers 32 dropbox: ~/Documents/dropbox/
sleep 2I then run it on startup by creating an entry on applications autostart (on login):
xfce4-terminal --geometry 210x40+0+0 --command=/home/user/sync_from_dropbox.shIt works splendidly. It syncs and shows the output on terminal for 2 additional seconds, so that I know that it worked.
I would like to do the same on logout, synchronizing from my local dir to dropbox.
I've setup everything in reverse, using another script:
#!/bin/bash
printf "Sync from local dropbox directory to remote\n\n"
rclone sync -v --dropbox-batch-mode sync --transfers 32 ~/Documents/dropbox/ dropbox:
sleep 2And also using application autostart (on logout):
xfce4-terminal --geometry 210x40+0+0 --command=/home/user/sync_to_dropbox.shBut this time the terminal window doesn't show up and the session simply ends.
How can I make the script run on logout, displaying the xfce4-terminal window before logging out effectively?
Thank you
Last edited by unni (2026-10-09 13:30:12)
Offline


Unfortunately, xfce4-session does not have this level of graceful logout - it basically will kill the X session which will kill any running X app. Here is a thread that talks about a potential workaround.
Another potential option would be to drop the X app output (have it redirect to some sort of log file that you can check) and enable systemd/logind linger to have the process continue though the logout process. Check the log file to see the outcome.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


Thank you for the reply.
I've managed to work around the problem by creating a separate script file that calls the rclone script and then calls xfce4-session-logout.
It looks like this:
#!/bin/bash
xfce4-terminal --geometry 210x40+0+0 --command=/home/user/sync_to_dropbox.sh
xfce4-session-logoutThen I made a .desktop file that calls that script and replaced the logout actions buttons with that .desktop file.
It calls the rclone script before calling the logout dialog box.
It's not a very refined solution but it works for my intended use case.
Offline
[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 534.64 KiB (Peak: 536.05 KiB) ]